1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.om.registry;
18
19
20 import java.util.Vector;
21
22
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 getAccesses();
42
43 /*** Setter for property accesses.
44 * @param accesses New value of property accesses.
45 */
46 public void setAccesses(Vector accesses);
47
48 /*** Getter for property name.
49 * @return Value of property name.
50 */
51 public String getName();
52
53 /*** Setter for property name.
54 * @param name New value of property name.
55 */
56 public void setName(String name);
57
58 /*** Getter for property description.
59 * @return Value of property description.
60 */
61 public String getDescription();
62
63 /*** Setter for property description.
64 * @param description New value of property description.
65 */
66 public void setDescription(String 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 getTitle();
82
83 /*** Setter for property title.
84 * @param title New value of property title.
85 */
86 public void setTitle(String 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 role, String 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 group, String 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 group, String role, String 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 userName, String 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 userName, String action, String 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 action, String 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 action, String 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 action, String 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 action, String 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 action, String group, String 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 action, String group, String 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 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 action, String 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 action, String 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 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 action, String 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 action, String 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 action, String 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 action, String group, String role);
302
303 }