1 package org.apache.turbine.om.security;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.Serializable;
23
24 import org.apache.turbine.util.security.RoleSet;
25 import org.apache.turbine.util.security.TurbineSecurityException;
26
27 /***
28 * This class represents a Group of Users in the system that are associated
29 * with specific entity or resource. The users belonging to the Group may have
30 * various Roles. The Permissions to perform actions upon the resource depend
31 * on the Roles in the Group that they are assigned.
32 *
33 * @author <a href="mailto:Rafal.Krzewski@e-point.pl">Rafal Krzewski</a>
34 * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
35 * @version $Id: Group.java 534527 2007-05-02 16:10:59Z tv $
36 */
37 public interface Group extends SecurityEntity, Serializable
38 {
39 /***
40 * The name of the <a href="#global">global group</a>
41 */
42 String GLOBAL_GROUP_NAME = "global";
43
44 /***
45 * Makes changes made to the Group attributes permanent.
46 *
47 * @throws TurbineSecurityException if there is a problem while
48 * saving data.
49 */
50 void save()
51 throws TurbineSecurityException;
52
53 /***
54 * Removes a group from the system.
55 *
56 * @throws TurbineSecurityException if the Group could not be removed.
57 */
58 void remove()
59 throws TurbineSecurityException;
60
61 /***
62 * Renames the role.
63 *
64 * @param name The new Group name.
65 * @throws TurbineSecurityException if the Group could not be renamed.
66 */
67 void rename(String name)
68 throws TurbineSecurityException;
69
70 /***
71 * Grants a Role in this Group to an User.
72 *
73 * @param user An User.
74 * @param role A Role.
75 * @throws TurbineSecurityException if there is a problem while assigning
76 * the Role.
77 */
78 void grant(User user, Role role)
79 throws TurbineSecurityException;
80
81 /***
82 * Grants Roles in this Group to an User.
83 *
84 * @param user An User.
85 * @param roleSet A RoleSet.
86 * @throws TurbineSecurityException if there is a problem while assigning
87 * the Roles.
88 */
89 void grant(User user, RoleSet roleSet)
90 throws TurbineSecurityException;
91
92 /***
93 * Revokes a Role in this Group from an User.
94 *
95 * @param user An User.
96 * @param role A Role.
97 * @throws TurbineSecurityException if there is a problem while unassigning
98 * the Role.
99 */
100 void revoke(User user, Role role)
101 throws TurbineSecurityException;
102
103 /***
104 * Revokes Roles in this group from an User.
105 *
106 * @param user An User.
107 * @param roleSet a RoleSet.
108 * @throws TurbineSecurityException if there is a problem while unassigning
109 * the Roles.
110 */
111 void revoke(User user, RoleSet roleSet)
112 throws TurbineSecurityException;
113
114 }