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