1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.acegisecurity;
17
18 /***
19 * Represents an authority granted to an {@link Authentication} object.
20 *
21 * <p>
22 * A <code>GrantedAuthority</code> must either represent itself as a
23 * <code>String</code> or be specifically supported by an {@link
24 * AccessDecisionManager}.
25 * </p>
26 *
27 * @author Ben Alex
28 * @version $Id: GrantedAuthority.java,v 1.3 2005/11/17 00:55:49 benalex Exp $
29 */
30 public interface GrantedAuthority {
31
32
33 /***
34 * If the <code>GrantedAuthority</code> can be represented as a
35 * <code>String</code> and that <code>String</code> is sufficient in
36 * precision to be relied upon for an access control decision by an {@link
37 * AccessDecisionManager} (or delegate), this method should return such a
38 * <code>String</code>.
39 *
40 * <p>
41 * If the <code>GrantedAuthority</code> cannot be expressed with sufficient
42 * precision as a <code>String</code>, <code>null</code> should be
43 * returned. Returning <code>null</code> will require an
44 * <code>AccessDecisionManager</code> (or delegate) to specifically
45 * support the <code>GrantedAuthority</code> implementation, so returning
46 * <code>null</code> should be avoided unless actually required.
47 * </p>
48 *
49 * @return a representation of the granted authority (or <code>null</code>
50 * if the granted authority cannot be expressed as a
51 * <code>String</code> with sufficient precision).
52 */
53 public String getAuthority();
54 }