KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jetspeed > om > registry > SecurityEntry


1 /*
2  * Copyright 2000-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.jetspeed.om.registry;
18
19 // Java imports
20
import java.util.Vector JavaDoc;
21
22 // Jetspeed imports
23
import org.apache.jetspeed.om.SecurityReference;
24 import org.apache.jetspeed.om.registry.MetaInfo;
25
26 /**
27  * Interface for manipulatin the security entries on the registry entries
28  *
29  *
30  * @author <a HREF="mailto:paulsp@apache.org">Paul Spencer</a>
31  * @author <a HREF="mailto:weaver@apache.org">Scott T. Weaver</a>
32  * @author <a HREF="mailto:morciuch@apache.org">Mark Orciuch</a>
33  * @version $Id: SecurityEntry.java,v 1.6 2004/02/23 03:11:39 jford Exp $
34  */

35
36 public interface SecurityEntry {
37
38     /** Getter for property accesses.
39      * @return Value of property accesses.
40      */

41     public Vector JavaDoc getAccesses();
42     
43     /** Setter for property accesses.
44      * @param accesses New value of property accesses.
45      */

46     public void setAccesses(Vector JavaDoc accesses);
47     
48     /** Getter for property name.
49      * @return Value of property name.
50      */

51     public String JavaDoc getName();
52     
53     /** Setter for property name.
54      * @param name New value of property name.
55      */

56     public void setName(String JavaDoc name);
57     
58     /** Getter for property description.
59      * @return Value of property description.
60      */

61     public String JavaDoc getDescription();
62     
63     /** Setter for property description.
64      * @param description New value of property description.
65      */

66     public void setDescription(String JavaDoc description);
67     
68     /** Getter for property securityRef.
69      * @return Value of property securityRef.
70      */

71     public SecurityReference getSecurityRef();
72     
73     /** Setter for property securityRef.
74      * @param securityRef New value of property securityRef.
75      */

76     public void setSecurityRef(SecurityReference securityRef);
77     
78     /** Getter for property title.
79      * @return Value of property title.
80      */

81     public String JavaDoc getTitle();
82     
83     /** Setter for property title.
84      * @param title New value of property title.
85      */

86     public void setTitle(String JavaDoc title);
87     
88     /** Getter for property metaInfo.
89      * @return Value of property metaInfo.
90      */

91     public MetaInfo getMetaInfo();
92     
93     /** Setter for property metaInfo.
94      * @param metaInfo New value of property metaInfo.
95      */

96     public void setMetaInfo(MetaInfo metaInfo);
97     
98     /** Getter for property hidden.
99      * @return Value of property hidden.
100      */

101     public boolean isHidden();
102     
103     /** Setter for property hidden.
104      * @param hidden New value of property hidden.
105      */

106     public void setHidden(boolean hidden);
107     
108     /** Getter for property id.
109      * @return Value of property id.
110      */

111     public long getId();
112     
113     /**
114      * Aututhorizes action for a role
115      *
116      * @param role requesting action
117      * @param action being requested
118      * @return <CODE>true</CODE> if action is allowed for role
119      */

120     public boolean allowsRole(String JavaDoc role, String JavaDoc action);
121
122     /**
123      * Authorizes action for a group
124      *
125      * @param group requesting action
126      * @param action being requested
127      * @return <CODE>true</CODE> if action is allowed for role
128      */

129     public boolean allowsGroup(String JavaDoc group, String JavaDoc action);
130
131     /**
132      * Authorizes action for a group role
133      *
134      * @param group requesting action
135      * @param role requesting action
136      * @param action being requested
137      * @return <CODE>true</CODE> if action is allowed for role
138      */

139     public boolean allowsGroupRole(String JavaDoc group, String JavaDoc role, String JavaDoc action);
140     
141     /**
142      * Aututhorizes action for a named user
143      *
144      * @param userName requesting action
145      * @param action being requested
146      * @return <CODE>true</CODE> if action is allowed for named user
147      */

148     public boolean allowsUser(String JavaDoc userName, String JavaDoc action);
149     
150     /**
151      * Aututhorizes action for a named user
152      *
153      * @param userName requesting action
154      * @param action being requested
155      * @param ownerUserName Onwers username
156      * @return <CODE>true</CODE> if action is allowed for named user
157      */

158     boolean allowsUser(String JavaDoc userName, String JavaDoc action, String JavaDoc ownerUserName);
159     
160     /**
161      * Grants access for a specific action to a specific role
162      * for this SecurityEntry. This grants specific access ignores
163      * "*" action, if it exists.
164      * @param String action The action we are granting access to.
165      * @param String role The role that will receive access to this action.
166      * @return boolean Whether or not the access was granted. Basically,
167      * a <code>false</code> means that this role already has specific access.
168      */

169        boolean grantRoleAccess(String JavaDoc action, String JavaDoc role);
170
171          /**
172          * Checks whether a role is specifically allowed to access the request action
173          * This method ignores the "*" action and is here to play a maintenance role.
174          * @param String action name of action to check
175          * @param String role name of role to verify access for
176          * @return boolean whether or not the <code>role</code> has access
177          * to this specific action.
178          */

179         boolean allowsSpecificRole(String JavaDoc action, String JavaDoc role);
180
181    /**
182     * Grants access for a specific action to a specific group
183     * for this SecurityEntry. This grants specific access ignores
184     * "*" action, if it exists.
185     * @param String action The action we are granting access to.
186     * @param String group The group that will receive access to this action.
187     * @return boolean Whether or not the access was granted. Basically,
188     * a <code>false</code> means that this group already has specific access.
189     */

190     boolean grantGroupAccess(String JavaDoc action, String JavaDoc group);
191
192    /**
193     * Checks whether a group is specifically allowed to access the request action
194     * This method ignores the "*" action and is here to play a maintenance role.
195     * @param String action name of action to check
196     * @param String group name of group to verify access for
197     * @return boolean whether or not the <code>group</code> has access
198     * to this specific action.
199     */

200     boolean allowsSpecificGroup(String JavaDoc action, String JavaDoc group);
201
202     /**
203      * Grants access for a specific action to a specific group role
204      * for this SecurityEntry. This grants specific access ignores
205      * "*" action, if it exists.
206      * @param String action The action we are granting access to.
207      * @param String group The group that will receive access to this action.
208      * @param String role The role that will receive access to this action.
209      * @return boolean Whether or not the access was granted. Basically,
210      * a <code>false</code> means that this group role already has specific access.
211      */

212      boolean grantGroupRoleAccess(String JavaDoc action, String JavaDoc group, String JavaDoc role);
213
214     /**
215      * Checks whether a group role is specifically allowed to access the request action
216      * This method ignores the "*" action and is here to play a maintenance role.
217      * @param String action name of action to check
218      * @param String group name of group to verify access for
219      * @param String role name of group to verify access for
220      * @return boolean whether or not the <code>group role</code> has access
221      * to this specific action.
222      */

223      boolean allowsSpecificGroupRole(String JavaDoc action, String JavaDoc group, String JavaDoc role);
224
225         /**
226          * Returns the SecurityAccess object for the <code>action</code>
227          * requested or null if no specific access is defined for this action.
228          * The "*" does change this, if an action is not specifically defined
229          * in the registry, null is returned
230          * @param SecurityEntry entry SecurityEntry to check against
231          * @param String action The action we want the access for.
232          * @return SecurityAccess that is defined for this action or
233          * <code>null</code> if one is not <strong>specifically defined</strong>
234          */

235         SecurityAccess getAccess(String JavaDoc action);
236
237         /**
238          * Checks whether a user is specifically allowed to access the request action
239          * This method ignores the "*" action and is here to play a maintenance role.
240          * @param String action name of action to check
241          * @param String user name of user to verify access for
242          * @return boolean whether or not the <code>user</code> has access
243          * to this specific action.
244          */

245         boolean allowsSpecificUser(String JavaDoc action, String JavaDoc user);
246
247     /**
248      * Grants access for a specific action to a specific user
249      * for this SecurityEntry. This grants specific access ignores
250      * "*" action, if it exists.
251      * @param String action The action we are granting access to.
252      * @param String user The user that will receive access to this action.
253      * @return boolean Whether or not the access was granted. Basically,
254      * a <code>false</code> means that this role already has specific access.
255      */

256         boolean grantUserAccess(String JavaDoc action, String JavaDoc user);
257
258         /**
259          * Removes a security access for the named action.
260          * This does not take into account the "*" action when
261          * the "*" is not the named action.
262          * @param String access name of access to remove in its entirety
263          */

264         void revokeAccess(String JavaDoc action);
265         
266         /**
267         * Removes a user's access to a specific action.
268         * @param action Action to remove access from.
269         * @param role The role whose access we are revoking.
270         * @return boolean Whehter or not the access existed and
271         * was removed.
272         */

273         boolean revokeUserAccess(String JavaDoc action, String JavaDoc user);
274
275     /**
276      * Removes a role's access to a specific action.
277      * @param action Action to remove access from.
278      * @param role The role whose access we are revoking.
279      * @return boolean Whehter or not the access existed and
280      * was removed.
281      */

282         boolean revokeRoleAccess(String JavaDoc action, String JavaDoc role);
283         
284     /**
285      * Removes a group's access to a specific action.
286      * @param action Action to remove access from.
287      * @param group The group whose access we are revoking.
288      * @return boolean Whether or not the access existed and
289      * was removed.
290      */

291     boolean revokeGroupAccess(String JavaDoc action, String JavaDoc group);
292
293     /**
294      * Removes a group role's access to a specific action.
295      * @param action Action to remove access from.
296      * @param group The group whose access we are revoking.
297      * @param role The role whose access we are revoking.
298      * @return boolean Whether or not the access existed and
299      * was removed.
300      */

301     boolean revokeGroupRoleAccess(String JavaDoc action, String JavaDoc group, String JavaDoc role);
302         
303 }
304
Popular Tags