001: package org.apache.turbine.om.security;
002:
003: /*
004: * Copyright 2001-2005 The Apache Software Foundation.
005: *
006: * Licensed under the Apache License, Version 2.0 (the "License")
007: * you may not use this file except in compliance with the License.
008: * You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing, software
013: * distributed under the License is distributed on an "AS IS" BASIS,
014: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: * See the License for the specific language governing permissions and
016: * limitations under the License.
017: */
018:
019: import org.apache.turbine.util.security.RoleSet;
020: import org.apache.turbine.util.security.TurbineSecurityException;
021:
022: /**
023: * This class represents a Group of Users in the system that are associated
024: * with specific entity or resource. The users belonging to the Group may have
025: * various Roles. The Permissions to perform actions upon the resource depend
026: * on the Roles in the Group that they are assigned.
027: *
028: * @author <a href="mailto:Rafal.Krzewski@e-point.pl">Rafal Krzewski</a>
029: * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
030: * @version $Id: Group.java 264148 2005-08-29 14:21:04Z henning $
031: */
032: public interface Group extends SecurityEntity {
033: /**
034: * The name of the <a href="#global">global group</a>
035: */
036: String GLOBAL_GROUP_NAME = "global";
037:
038: /**
039: * Makes changes made to the Group attributes permanent.
040: *
041: * @throws TurbineSecurityException if there is a problem while
042: * saving data.
043: */
044: void save() throws TurbineSecurityException;
045:
046: /**
047: * Removes a group from the system.
048: *
049: * @throws TurbineSecurityException if the Group could not be removed.
050: */
051: void remove() throws TurbineSecurityException;
052:
053: /**
054: * Renames the role.
055: *
056: * @param name The new Group name.
057: * @throws TurbineSecurityException if the Group could not be renamed.
058: */
059: void rename(String name) throws TurbineSecurityException;
060:
061: /**
062: * Grants a Role in this Group to an User.
063: *
064: * @param user An User.
065: * @param role A Role.
066: * @throws TurbineSecurityException if there is a problem while assigning
067: * the Role.
068: */
069: void grant(User user, Role role) throws TurbineSecurityException;
070:
071: /**
072: * Grants Roles in this Group to an User.
073: *
074: * @param user An User.
075: * @param roleSet A RoleSet.
076: * @throws TurbineSecurityException if there is a problem while assigning
077: * the Roles.
078: */
079: void grant(User user, RoleSet roleSet)
080: throws TurbineSecurityException;
081:
082: /**
083: * Revokes a Role in this Group from an User.
084: *
085: * @param user An User.
086: * @param role A Role.
087: * @throws TurbineSecurityException if there is a problem while unassigning
088: * the Role.
089: */
090: void revoke(User user, Role role) throws TurbineSecurityException;
091:
092: /**
093: * Revokes Roles in this group from an User.
094: *
095: * @param user An User.
096: * @param roleSet a RoleSet.
097: * @throws TurbineSecurityException if there is a problem while unassigning
098: * the Roles.
099: */
100: void revoke(User user, RoleSet roleSet)
101: throws TurbineSecurityException;
102:
103: }
|