1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.acegisecurity.acl;
17
18 import org.acegisecurity.Authentication;
19
20 /***
21 * Indicates a class can process a given domain object instance and
22 * authoritatively return the ACLs that apply.
23 *
24 * <P>
25 * Implementations are typically called from the {@link AclProviderManager}.
26 * </p>
27 *
28 * @author Ben Alex
29 * @version $Id: AclProvider.java,v 1.2 2005/11/17 00:55:51 benalex Exp $
30 */
31 public interface AclProvider {
32
33
34 /***
35 * Obtains the ACLs that apply to the specified domain instance.
36 *
37 * <P>
38 * Will never be called unless the {@link #supports(Object)} method
39 * returned <code>true</code>.
40 * </p>
41 *
42 * @param domainInstance the instance for which ACL information is required
43 * (never <code>null</code>)
44 *
45 * @return the ACLs that apply, or <code>null</code> if no ACLs apply to
46 * the specified domain instance
47 */
48 public AclEntry[] getAcls(Object domainInstance);
49
50 /***
51 * Obtains the ACLs that apply to the specified domain instance
52 * and presented <code>Authentication</code> object.
53 *
54 * <P>
55 * Will never be called unless the {@link #supports(Object)} method
56 * returned <code>true</code>.
57 * </p>
58 *
59 * @param domainInstance the instance for which ACL information is required
60 * (never <code>null</code>)
61 * @param authentication the prncipal for which ACL information should be
62 * filtered (never <code>null</code>)
63 *
64 * @return only those ACLs applying to the domain instance that have been
65 * granted to the principal (or <code>null</code>) if no such ACLs
66 * are found
67 */
68 public AclEntry[] getAcls(Object domainInstance,
69 Authentication authentication);
70
71 /***
72 * Indicates whether this <code>AclProvider</code> can authoritatively
73 * return ACL information for the specified domain object instance.
74 *
75 * @param domainInstance the instance for which ACL information is required
76 * (never <code>null</code>)
77 *
78 * @return <code>true</code> if this provider is authoritative for the
79 * specified domain object instance, <code>false</code> otherwise
80 */
81 public boolean supports(Object domainInstance);
82 }