info.magnolia.cms.security
Class MgnlRoleManager

java.lang.Object
  extended by info.magnolia.cms.security.RepositoryBackedSecurityManager
      extended by info.magnolia.cms.security.MgnlRoleManager
All Implemented Interfaces:
RoleManager

public class MgnlRoleManager
extends RepositoryBackedSecurityManager
implements RoleManager

Manages the users stored in the RepositoryConstants.USER_ROLES workspace.


Field Summary
static String NODE_ACLROLES
           
 
Constructor Summary
MgnlRoleManager()
           
 
Method Summary
 void addPermission(Role role, String workspace, String path, long permission)
          Add permission to the specified role, assuming current user has enough rights to perform such operation.
 Role createRole(String name)
          Creates a new role in the root folder without any security restrictions.
 Role createRole(String path, String name)
          Create a new role in a specific folder without any security restrictions.
protected  javax.jcr.Node findPrincipalNode(String principalName, javax.jcr.Session session)
          Helper method to find a role.
protected  HierarchyManager getHierarchyManager()
          Deprecated. since 5.2
protected  String getRepositoryName()
           
 Role getRole(String name)
          Get the specific role.
 String getRoleNameById(String string)
          Retrieve role name by its identifier.
protected  MgnlRole newRoleInstance(Content node)
          Deprecated. since 4.5
protected  MgnlRole newRoleInstance(javax.jcr.Node node)
           
 void removePermission(Role role, String workspace, String path, long permission)
          Remove permission from the specified role.
protected  void validateRoleName(String name)
           
 
Methods inherited from class info.magnolia.cms.security.RepositoryBackedSecurityManager
add, findPrincipalNode, findPrincipalNode, 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.RoleManager
getACLs
 

Field Detail

NODE_ACLROLES

public static final String NODE_ACLROLES
See Also:
Constant Field Values
Constructor Detail

MgnlRoleManager

public MgnlRoleManager()
Method Detail

getRole

public Role getRole(String name)
Description copied from interface: RoleManager
Get the specific role.

Specified by:
getRole in interface RoleManager

createRole

public Role createRole(String name)
                throws AccessDeniedException
Description copied from interface: RoleManager
Creates a new role in the root folder without any security restrictions.

Specified by:
createRole in interface RoleManager
Throws:
AccessDeniedException

createRole

public Role createRole(String path,
                       String name)
                throws AccessDeniedException
Create a new role in a specific folder without any security restrictions.

Specified by:
createRole in interface RoleManager
Throws:
IllegalArgumentException - if the name is not valid or if a group with this name already exists
UnsupportedOperationException - in case the role manager does not support this operation
AccessDeniedException

newRoleInstance

@Deprecated
protected MgnlRole newRoleInstance(Content node)
                            throws javax.jcr.RepositoryException
Deprecated. since 4.5

Throws:
javax.jcr.RepositoryException

newRoleInstance

protected MgnlRole newRoleInstance(javax.jcr.Node node)
                            throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getHierarchyManager

@Deprecated
protected HierarchyManager getHierarchyManager()
Deprecated. since 5.2


removePermission

public void removePermission(Role role,
                             String workspace,
                             String path,
                             long permission)
Description copied from interface: RoleManager
Remove permission from the specified role.

Specified by:
removePermission in interface RoleManager

addPermission

public void addPermission(Role role,
                          String workspace,
                          String path,
                          long permission)
Description copied from interface: RoleManager
Add permission to the specified role, assuming current user has enough rights to perform such operation.

Specified by:
addPermission in interface RoleManager

findPrincipalNode

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

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

getRepositoryName

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

getRoleNameById

public String getRoleNameById(String string)
Description copied from interface: RoleManager
Retrieve role name by its identifier.

Specified by:
getRoleNameById in interface RoleManager

validateRoleName

protected void validateRoleName(String name)
                         throws AccessDeniedException
Throws:
AccessDeniedException


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