KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > security > auth > AuthPermission


1 /*
2  * @(#)AuthPermission.java 1.51 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.security.auth;
9
10 /**
11  * This class is for authentication permissions.
12  * An AuthPermission contains a name
13  * (also referred to as a "target name")
14  * but no actions list; you either have the named permission
15  * or you don't.
16  *
17  * <p> The target name is the name of a security configuration parameter
18  * (see below). Currently the AuthPermission object is used to
19  * guard access to the Policy, Subject, LoginContext,
20  * and Configuration objects.
21  *
22  * <p> The possible target names for an Authentication Permission are:
23  *
24  * <pre>
25  * doAs - allow the caller to invoke the
26  * <code>Subject.doAs</code> methods.
27  *
28  * doAsPrivileged - allow the caller to invoke the
29  * <code>Subject.doAsPrivileged</code> methods.
30  *
31  * getSubject - allow for the retrieval of the
32  * Subject(s) associated with the
33  * current Thread.
34  *
35  * getSubjectFromDomainCombiner - allow for the retrieval of the
36  * Subject associated with the
37  * a <code>SubjectDomainCombiner</code>.
38  *
39  * setReadOnly - allow the caller to set a Subject
40  * to be read-only.
41  *
42  * modifyPrincipals - allow the caller to modify the <code>Set</code>
43  * of Principals associated with a
44  * <code>Subject</code>
45  *
46  * modifyPublicCredentials - allow the caller to modify the
47  * <code>Set</code> of public credentials
48  * associated with a <code>Subject</code>
49  *
50  * modifyPrivateCredentials - allow the caller to modify the
51  * <code>Set</code> of private credentials
52  * associated with a <code>Subject</code>
53  *
54  * refreshCredential - allow code to invoke the <code>refresh</code>
55  * method on a credential which implements
56  * the <code>Refreshable</code> interface.
57  *
58  * destroyCredential - allow code to invoke the <code>destroy</code>
59  * method on a credential <code>object</code>
60  * which implements the <code>Destroyable</code>
61  * interface.
62  *
63  * createLoginContext.{name} - allow code to instantiate a
64  * <code>LoginContext</code> with the
65  * specified <i>name</i>. <i>name</i>
66  * is used as the index into the installed login
67  * <code>Configuration</code>
68  * (that returned by
69  * <code>Configuration.getConfiguration()</code>).
70  * <i>name</i> can be wildcarded (set to '*')
71  * to allow for any name.
72  *
73  * getLoginConfiguration - allow for the retrieval of the system-wide
74  * login Configuration.
75  *
76  * setLoginConfiguration - allow for the setting of the system-wide
77  * login Configuration.
78  *
79  * refreshLoginConfiguration - allow for the refreshing of the system-wide
80  * login Configuration.
81  * </pre>
82  *
83  * <p> The following target name has been deprecated in favor of
84  * <code>createLoginContext.{name}</code>.
85  *
86  * <pre>
87  * createLoginContext - allow code to instantiate a
88  * <code>LoginContext</code>.
89  * </pre>
90  *
91  * <p> <code>javax.security.auth.Policy</code> has been
92  * deprecated in favor of <code>java.security.Policy</code>.
93  * Therefore, the following target names have also been deprecated:
94  *
95  * <pre>
96  * getPolicy - allow the caller to retrieve the system-wide
97  * Subject-based access control policy.
98  *
99  * setPolicy - allow the caller to set the system-wide
100  * Subject-based access control policy.
101  *
102  * refreshPolicy - allow the caller to refresh the system-wide
103  * Subject-based access control policy.
104  * </pre>
105  *
106  * @version 1.51, 12/19/03
107  */

108 public final class AuthPermission extends
109 java.security.BasicPermission JavaDoc {
110
111     private static final long serialVersionUID = 5806031445061587174L;
112
113     /**
114      * Creates a new AuthPermission with the specified name.
115      * The name is the symbolic name of the AuthPermission.
116      *
117      * <p>
118      *
119      * @param name the name of the AuthPermission
120      */

121     public AuthPermission(String JavaDoc name) {
122     // for backwards compatibility --
123
// createLoginContext is deprecated in favor of createLoginContext.*
124
super("createLoginContext".equals(name) ?
125         "createLoginContext.*" : name);
126     }
127
128     /**
129      * Creates a new AuthPermission object with the specified name.
130      * The name is the symbolic name of the AuthPermission, and the
131      * actions String is currently unused and should be null.
132      *
133      * <p>
134      *
135      * @param name the name of the AuthPermission <p>
136      *
137      * @param actions should be null.
138      */

139     public AuthPermission(String JavaDoc name, String JavaDoc actions) {
140     // for backwards compatibility --
141
// createLoginContext is deprecated in favor of createLoginContext.*
142
super("createLoginContext".equals(name) ?
143         "createLoginContext.*" : name, actions);
144     }
145 }
146
Popular Tags