001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.wicket.authroles.authorization.strategies.role.annotations; 018 019import java.lang.annotation.Documented; 020import java.lang.annotation.ElementType; 021import java.lang.annotation.Inherited; 022import java.lang.annotation.Retention; 023import java.lang.annotation.RetentionPolicy; 024import java.lang.annotation.Target; 025 026/** 027 * Groups a set (technically an array) of {@link AuthorizeInstantiation}s for page authorization. 028 * 029 * This offers the ability to instantiate a page based on combined permissions / roles required. It 030 * represents an AND relationship between the included permissions / roles. 031 * 032 * This can be used like this: 033 * 034 * <pre> 035 * @AuthorizeInstantiations(ruleset = { @AuthorizeInstantiation("ADMIN"), 036 * @AuthorizeInstantiation("MANAGER") }) 037 * public class ForAdministrativeManagers extends WebPage 038 * { 039 * public ForAdministrativeManagers() 040 * { 041 * super(); 042 * } 043 * } 044 * </pre> 045 * 046 * @see org.apache.wicket.authorization.IAuthorizationStrategy 047 * @see AnnotationsRoleAuthorizationStrategy 048 * @see AuthorizeInstantiation 049 * @see AuthorizeInstantiations 050 * @author René Dieckmann (rene.dieckmann@menoto.de) 051 */ 052@Retention(RetentionPolicy.RUNTIME) 053@Target({ ElementType.TYPE }) 054@Documented 055@Inherited 056public @interface AuthorizeInstantiations { 057 058 /** 059 * The combined ruleset. 060 * 061 * @return the combined ruleset 062 */ 063 AuthorizeInstantiation[] ruleset(); 064}