View Javadoc

1   /* Copyright 2004, 2005, 2006 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 1784 2007-02-24 21:00:24Z luke_t $
30   */
31  public interface AfterInvocationProvider {
32      //~ Methods ========================================================================================================
33  
34      Object decide(Authentication authentication, Object object, ConfigAttributeDefinition config,
35          Object returnedObject) throws AccessDeniedException;
36  
37      /**
38       * Indicates whether this <code>AfterInvocationProvider</code> is able to participate in a decision
39       * involving the passed <code>ConfigAttribute</code>.<p>This allows the
40       * <code>AbstractSecurityInterceptor</code> to check every configuration attribute can be consumed by the
41       * configured <code>AccessDecisionManager</code> and/or <code>RunAsManager</code> and/or
42       * <code>AccessDecisionManager</code>.</p>
43       *
44       * @param attribute a configuration attribute that has been configured against the
45       *        <code>AbstractSecurityInterceptor</code>
46       *
47       * @return true if this <code>AfterInvocationProvider</code> can support the passed configuration attribute
48       */
49      boolean supports(ConfigAttribute attribute);
50  
51      /**
52       * Indicates whether the <code>AfterInvocationProvider</code> is able to provide "after invocation"
53       * processing for the indicated secured object type.
54       *
55       * @param clazz the class of secure object that is being queried
56       *
57       * @return true if the implementation can process the indicated class
58       */
59      boolean supports(Class clazz);
60  }