01: /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
02: *
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * 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: * Indicates a class is responsible for participating in an {@link
25: * AfterInvocationProviderManager} decision.
26: *
27: * @author Ben Alex
28: * @version $Id: AfterInvocationProvider.java 1784 2007-02-24 21:00:24Z luke_t $
29: */
30: public interface AfterInvocationProvider {
31: //~ Methods ========================================================================================================
32:
33: Object decide(Authentication authentication, Object object,
34: ConfigAttributeDefinition config, Object returnedObject)
35: 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: }
|