View Javadoc

1   /* Copyright 2004 Acegi Technology Pty Limited
2    *
3    * Licensed under the Apache License, Version 2.0 (the "License");
4    * you may not use this file except in compliance with the License.
5    * You may obtain a copy of the License at
6    *
7    *     http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  
16  package org.acegisecurity.afterinvocation;
17  
18  import org.acegisecurity.AccessDeniedException;
19  import org.acegisecurity.Authentication;
20  import org.acegisecurity.ConfigAttribute;
21  import org.acegisecurity.ConfigAttributeDefinition;
22  
23  
24  /***
25   * Indicates a class is responsible for participating in an {@link
26   * AfterInvocationProviderManager} decision.
27   *
28   * @author Ben Alex
29   * @version $Id: AfterInvocationProvider.java,v 1.2 2005/11/17 00:55:56 benalex Exp $
30   */
31  public interface AfterInvocationProvider {
32      //~ Methods ================================================================
33  
34      public Object decide(Authentication authentication, Object object,
35          ConfigAttributeDefinition config, Object returnedObject)
36          throws AccessDeniedException;
37  
38      /***
39       * Indicates whether this <code>AfterInvocationProvider</code> is able to
40       * participate in a decision involving the passed
41       * <code>ConfigAttribute</code>.
42       * 
43       * <p>
44       * This allows the <code>AbstractSecurityInterceptor</code> to check every
45       * configuration attribute can be consumed by the configured
46       * <code>AccessDecisionManager</code> and/or <code>RunAsManager</code>
47       * and/or <code>AccessDecisionManager</code>.
48       * </p>
49       *
50       * @param attribute a configuration attribute that has been configured
51       *        against the <code>AbstractSecurityInterceptor</code>
52       *
53       * @return true if this <code>AfterInvocationProvider</code> can support
54       *         the passed configuration attribute
55       */
56      public boolean supports(ConfigAttribute attribute);
57  
58      /***
59       * Indicates whether the <code>AfterInvocationProvider</code> is able to
60       * provide "after invocation" processing for the indicated secured object
61       * type.
62       *
63       * @param clazz the class of secure object that is being queried
64       *
65       * @return true if the implementation can process the indicated class
66       */
67      public boolean supports(Class clazz);
68  }