info.magnolia.cms.security
Class MgnlGroupManager

java.lang.Object
  extended by info.magnolia.cms.security.RepositoryBackedSecurityManager
      extended by info.magnolia.cms.security.MgnlGroupManager
All Implemented Interfaces:
GroupManager

public class MgnlGroupManager
extends RepositoryBackedSecurityManager
implements GroupManager

Group manager working directly with JCR API and returning simple groups (no JCR node aware).

Author:
Sameer Charles $Id$

Constructor Summary
MgnlGroupManager()
           
 
Method Summary
 Group addGroup(Group group, String groupName)
          Adds to the group to a group.
 Group addRole(Group group, String roleName)
          Grants to the group a role.
 Group createGroup(String name)
           
protected  javax.jcr.Node findPrincipalNode(String principalName, javax.jcr.Session session)
          Helper method to find a group.
 Collection<Group> getAllGroups()
          Get all groups defined in the system.
 Collection<String> getAllGroups(String name)
          Get all groups related to one concrete group.
 Group getGroup(String name)
           
protected  String getRepositoryName()
           
protected  Group newGroupInstance(javax.jcr.Node node)
           
 
Methods inherited from class info.magnolia.cms.security.RepositoryBackedSecurityManager
add, getACLs, getACLs, getResourceName, hasAny, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.magnolia.cms.security.GroupManager
getACLs
 

Constructor Detail

MgnlGroupManager

public MgnlGroupManager()
Method Detail

createGroup

public Group createGroup(String name)
                  throws AccessDeniedException
Specified by:
createGroup in interface GroupManager
Throws:
AccessDeniedException

getGroup

public Group getGroup(String name)
               throws AccessDeniedException
Specified by:
getGroup in interface GroupManager
Throws:
AccessDeniedException

getAllGroups

public Collection<Group> getAllGroups()
Description copied from interface: GroupManager
Get all groups defined in the system.

Specified by:
getAllGroups in interface GroupManager

getAllGroups

public Collection<String> getAllGroups(String name)
Description copied from interface: GroupManager
Get all groups related to one concrete group.

Specified by:
getAllGroups in interface GroupManager

newGroupInstance

protected Group newGroupInstance(javax.jcr.Node node)
                          throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

findPrincipalNode

protected javax.jcr.Node findPrincipalNode(String principalName,
                                           javax.jcr.Session session)
                                    throws javax.jcr.RepositoryException
Helper method to find a group. Uses JCR Query. This will return null if group doesn't exist.

Specified by:
findPrincipalNode in class RepositoryBackedSecurityManager
Throws:
javax.jcr.RepositoryException

getRepositoryName

protected String getRepositoryName()
Specified by:
getRepositoryName in class RepositoryBackedSecurityManager

addRole

public Group addRole(Group group,
                     String roleName)
              throws AccessDeniedException
Description copied from interface: GroupManager
Grants to the group a role.

Specified by:
addRole in interface GroupManager
Returns:
Group object with the role already granted.
Throws:
AccessDeniedException

addGroup

public Group addGroup(Group group,
                      String groupName)
               throws AccessDeniedException
Description copied from interface: GroupManager
Adds to the group to a group.

Specified by:
addGroup in interface GroupManager
Returns:
group object with the group already assigned.
Throws:
AccessDeniedException


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