info.magnolia.cms.security
Class MgnlGroup

java.lang.Object
  extended by info.magnolia.cms.security.MgnlGroup
All Implemented Interfaces:
Group, Serializable

public class MgnlGroup
extends Object
implements Group

A group implementation. This bean is not connected to the underlying group storage.

Author:
Sameer Charles $Id$
See Also:
Serialized Form

Constructor Summary
MgnlGroup(String id, String groupName, Collection<String> subgroupNames, Collection<String> roleNames)
           
 
Method Summary
 void addGroup(String groupName)
          Add a subgroup to this group.
 void addRole(String roleName)
           
 Collection<String> getAllGroups()
          Get all groups assigned to this group, collected recursively from subgroups.
 Collection<String> getGroups()
          Returns read only groups collection.
 String getId()
          Gets identifier of the group.
 String getName()
           
 String getProperty(String propertyName)
          FIXME: Yet another method that is questionable.
 Collection<String> getRoles()
          Returns read only roles collection.
 boolean hasRole(String roleName)
           
 void removeGroup(String groupName)
          Remove a subgroup from this group.
 void removeRole(String roleName)
           
 void setProperty(String propertyName, String value)
          Sets an arbitrary property for this group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MgnlGroup

public MgnlGroup(String id,
                 String groupName,
                 Collection<String> subgroupNames,
                 Collection<String> roleNames)
Method Detail

getName

public String getName()
Specified by:
getName in interface Group

addRole

public void addRole(String roleName)
             throws UnsupportedOperationException,
                    AccessDeniedException
Specified by:
addRole in interface Group
Throws:
UnsupportedOperationException
AccessDeniedException

addGroup

public void addGroup(String groupName)
              throws UnsupportedOperationException,
                     AccessDeniedException
Add a subgroup to this group.

Specified by:
addGroup in interface Group
Throws:
UnsupportedOperationException
AccessDeniedException

removeRole

public void removeRole(String roleName)
                throws UnsupportedOperationException,
                       AccessDeniedException
Specified by:
removeRole in interface Group
Throws:
UnsupportedOperationException
AccessDeniedException

removeGroup

public void removeGroup(String groupName)
                 throws UnsupportedOperationException,
                        AccessDeniedException
Remove a subgroup from this group.

Specified by:
removeGroup in interface Group
Throws:
UnsupportedOperationException
AccessDeniedException

hasRole

public boolean hasRole(String roleName)
                throws UnsupportedOperationException,
                       AccessDeniedException
Specified by:
hasRole in interface Group
Throws:
UnsupportedOperationException
AccessDeniedException

getProperty

public String getProperty(String propertyName)
FIXME: Yet another method that is questionable. Either we take all arbitrary properties of the group and load them in memory, wasting the time and memory on group instance creation or such props should be requested on demand from the manager. The fact that group interface exposes also setter for this method makes it even worse!

Specified by:
getProperty in interface Group

setProperty

public void setProperty(String propertyName,
                        String value)
Description copied from interface: Group
Sets an arbitrary property for this group.

Specified by:
setProperty in interface Group

getRoles

public Collection<String> getRoles()
Returns read only roles collection.

Specified by:
getRoles in interface Group
See Also:
Group.getRoles()

getGroups

public Collection<String> getGroups()
Returns read only groups collection.

Specified by:
getGroups in interface Group
See Also:
Group.getGroups()

getAllGroups

public Collection<String> getAllGroups()
Description copied from interface: Group
Get all groups assigned to this group, collected recursively from subgroups.

Specified by:
getAllGroups in interface Group

getId

public String getId()
Description copied from interface: Group
Gets identifier of the group.

Specified by:
getId in interface Group


Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.