public class MgnlGroupManager extends RepositoryBackedSecurityManager implements GroupManager
nodeNameHelper
Constructor and Description |
---|
MgnlGroupManager()
Deprecated.
since 5.5.3, use
MgnlGroupManager(NodeNameHelper) instead. |
MgnlGroupManager(NodeNameHelper nodeNameHelper) |
Modifier and Type | Method and Description |
---|---|
Group |
addGroup(Group group,
String groupName)
Adds a group to a group.
|
Group |
addRole(Group group,
String roleName)
Grants a role to a group.
|
Group |
createGroup(String name)
Creates a new group in the root folder.
|
Group |
createGroup(String path,
String name)
Creates a new group in a specific folder.
|
protected void |
findAllGroupsInFolder(javax.jcr.Node node,
Collection<Group> addTo)
Finds all groups located in the provided node or in sub-folders within it and adds them to the given collection.
|
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)
Returns all super-groups of the given group, i.e.
|
Collection<String> |
getAllSubGroups(String groupName)
Returns all sub-groups of the given group.
|
Collection<String> |
getAllSuperGroups(String groupName)
Returns all super-groups of the given group, i.e.
|
Collection<String> |
getDirectSubGroups(String groupName)
Returns sub-groups directly assigned to the given group.
|
Collection<String> |
getDirectSuperGroups(String groupName)
Returns direct super-groups of the given group.
|
Group |
getGroup(String name)
Get a group by name.
|
Collection<String> |
getGroupsWithGroup(String groupName)
Returns sub-groups directly assigned to the given group.
|
Collection<String> |
getGroupsWithRole(String roleName)
Returns all groups having assigned the provided role.
|
protected String |
getRepositoryName() |
protected Group |
newGroupInstance(javax.jcr.Node node) |
Group |
removeGroup(Group group,
String groupName)
Removes group from a group.
|
Group |
removeRole(Group group,
String roleName)
Removes role from a group.
|
protected void |
validateGroupName(String name) |
add, findPrincipalNode, findPrincipalNode, findPrincipalNodes, findUsersOrGroupsHavingAssignedGroupOrRoleWithUid, getACLs, getACLs, getResourceName, hasAny, remove
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getACLs
@Inject public MgnlGroupManager(NodeNameHelper nodeNameHelper)
@Deprecated public MgnlGroupManager()
MgnlGroupManager(NodeNameHelper)
instead.public Group createGroup(String name) throws AccessDeniedException
GroupManager
createGroup
in interface GroupManager
AccessDeniedException
public Group createGroup(String path, String name) throws AccessDeniedException
IllegalArgumentException
- if the name is not valid or if a group with this name already existsUnsupportedOperationException
- if the implementation does not support writingAccessDeniedException
public Group getGroup(String name) throws AccessDeniedException
GroupManager
getGroup
in interface GroupManager
AccessDeniedException
public Collection<Group> getAllGroups()
GroupManager
getAllGroups
in interface GroupManager
public Collection<String> getAllGroups(String name)
GroupManager
getAllGroups
in interface GroupManager
GroupManager.getAllSuperGroups(String)
protected Group newGroupInstance(javax.jcr.Node node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected javax.jcr.Node findPrincipalNode(String principalName, javax.jcr.Session session) throws javax.jcr.RepositoryException
findPrincipalNode
in class RepositoryBackedSecurityManager
javax.jcr.RepositoryException
protected String getRepositoryName()
getRepositoryName
in class RepositoryBackedSecurityManager
public Group addRole(Group group, String roleName) throws AccessDeniedException
GroupManager
addRole
in interface GroupManager
AccessDeniedException
public Group addGroup(Group group, String groupName) throws AccessDeniedException
GroupManager
addGroup
in interface GroupManager
AccessDeniedException
protected void findAllGroupsInFolder(javax.jcr.Node node, Collection<Group> addTo) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected void validateGroupName(String name) throws AccessDeniedException
AccessDeniedException
public Collection<String> getGroupsWithGroup(String groupName)
GroupManager
getGroupsWithGroup
in interface GroupManager
GroupManager.getDirectSubGroups(String)
public Collection<String> getDirectSubGroups(String groupName)
GroupManager
Given the following groups:
/ ├── people │ └──employees ("employees" is directly assigned to the "people" super-group) │ └──developers ("developers" is directly assigned to the "employees" super-group; and is thus transitively assigned to the "people" super-group) #getDirectSubGroups("people") = ["employees"] #getDirectSubGroups("employees") = ["developers"] #getDirectSubGroups("developers") = []
getDirectSubGroups
in interface GroupManager
public Collection<String> getDirectSuperGroups(String groupName)
GroupManager
Given the following groups:
/ ├── people │ └──employees ("employees" is directly assigned to the "people" super-group) │ └──developers ("developers" is directly assigned to the "employees" super-group; and is thus transitively assigned to the "people" super-group) #getDirectSuperGroups("people") = [] #getDirectSuperGroups("employees") = ["people"] #getDirectSuperGroups("developers") = ["employees"]
getDirectSuperGroups
in interface GroupManager
public Collection<String> getGroupsWithRole(String roleName)
GroupManager
getGroupsWithRole
in interface GroupManager
public Group removeGroup(Group group, String groupName) throws AccessDeniedException
GroupManager
removeGroup
in interface GroupManager
AccessDeniedException
public Group removeRole(Group group, String roleName) throws AccessDeniedException
GroupManager
removeRole
in interface GroupManager
AccessDeniedException
public Collection<String> getAllSuperGroups(String groupName) throws UnsupportedOperationException
GroupManager
Given the following groups:
/ ├── people │ └──employees ("employees" is directly assigned to the "people" super-group) │ └──developers ("developers" is directly assigned to the "employees" super-group; and is thus transitively assigned to the "people" super-group) #getAllSuperGroups("people") = [] #getAllSuperGroups("employees") = ["people"] #getAllSuperGroups("developers") = ["employees","people"]
getAllSuperGroups
in interface GroupManager
UnsupportedOperationException
public Collection<String> getAllSubGroups(String groupName) throws UnsupportedOperationException
GroupManager
Given the following groups:
/ ├── people │ └──employees ("employees" is directly assigned to the "people" super-group) │ └──developers ("developers" is directly assigned to the "employees" super-group; and is thus transitively assigned to the "people" super-group) #getAllSubGroups("people") = ["employees","developers"] #getAllSubGroups("employees") = ["developers"] #getAllSubGroups("developers") = []
getAllSubGroups
in interface GroupManager
UnsupportedOperationException
Copyright © 2003–2017 Magnolia International Ltd.. All rights reserved.