|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.opencms.security.CmsRoleManager
public class CmsRoleManager
This manager provide access to the role related operations.
| Constructor Summary | |
|---|---|
CmsRoleManager(CmsSecurityManager securityManager)
Default constructor. |
|
| Method Summary | |
|---|---|
void |
addUserToRole(CmsObject cms,
CmsRole role,
String username)
Adds a user to the given role. |
void |
checkRole(CmsObject cms,
CmsRole role)
Checks if the user of this OpenCms context is a member of the given role for the given organizational unit. |
void |
checkRoleForResource(CmsObject cms,
CmsRole role,
String resourceName)
Checks if the user of this OpenCms context is a member of the given role for the given resource. |
List<CmsGroup> |
getManageableGroups(CmsObject cms,
String ouFqn,
boolean includeSubOus)
Returns all groups of organizational units for which the current user has the CmsRole.ACCOUNT_MANAGER role. |
List<CmsOrganizationalUnit> |
getManageableOrgUnits(CmsObject cms,
String ouFqn,
boolean includeSubOus,
boolean includeWebusers)
Returns a list of those organizational units whose members can be managed by the current user. |
List<CmsResource> |
getManageableResources(CmsObject cms,
CmsRole role)
Returns all resources of organizational units for which the current user has the given role role. |
List<CmsUser> |
getManageableUsers(CmsObject cms,
String ouFqn,
boolean includeSubOus)
Returns all users of organizational units for which the current user has the CmsRole.ACCOUNT_MANAGER role. |
List<CmsUser> |
getManageableUsers(CmsObject cms,
String ouFqn,
boolean includeSubOus,
boolean includeWebusers)
Returns all users of organizational units for which the current user has the CmsRole.ACCOUNT_MANAGER role. |
List<CmsOrganizationalUnit> |
getOrgUnitsForRole(CmsObject cms,
CmsRole role,
boolean includeSubOus)
Returns all the organizational units for which the current user has the given role. |
Set<CmsGroup> |
getRoleGroups(CmsObject cms,
CmsRole role,
boolean directUsersOnly)
Returns the groups which constitute a given role, i.e. |
List<CmsRole> |
getRoles(CmsObject cms,
String ouFqn,
boolean includeSubOus)
Returns all roles, in the given organizational unit. |
List<CmsRole> |
getRolesForResource(CmsObject cms,
String userFqn,
String resourceName)
Returns all roles the given user has over the given resource. |
List<CmsRole> |
getRolesOfUser(CmsObject cms,
String username,
String ouFqn,
boolean includeChildOus,
boolean directRolesOnly,
boolean recursive)
Returns all roles the given user belongs to, in the given organizational unit. |
List<CmsUser> |
getUsersOfRole(CmsObject cms,
CmsRole role,
boolean includeOtherOuUsers,
boolean directUsersOnly)
Returns all direct users of a given role, in the given organizational unit. |
boolean |
hasRole(CmsObject cms,
CmsRole role)
Checks if the given context user has the given role in the given organizational unit. |
boolean |
hasRole(CmsObject cms,
String userName,
CmsRole role)
Checks if the given user has the given role in the given organizational unit. |
boolean |
hasRoleForResource(CmsObject cms,
CmsRole role,
String resourceName)
Checks if the given context user has the given role for the given resource. |
boolean |
hasRoleForResource(CmsObject cms,
String userName,
CmsRole role,
String resourceName)
Checks if the given context user has the given role for the given resource. |
void |
removeUserFromRole(CmsObject cms,
CmsRole role,
String username)
Removes a user from a role, in the given organizational unit. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CmsRoleManager(CmsSecurityManager securityManager)
securityManager - the security manager| Method Detail |
|---|
public Set<CmsGroup> getRoleGroups(CmsObject cms,
CmsRole role,
boolean directUsersOnly)
throws CmsException
cms - the CMS contextrole - the roledirectUsersOnly - if true, only the role's direct group will be returned
CmsException - if something goes wrong
public void addUserToRole(CmsObject cms,
CmsRole role,
String username)
throws CmsException
cms - the opencms contextrole - the roleusername - the name of the user that is to be added to the role
CmsException - if something goes wrong
public void checkRole(CmsObject cms,
CmsRole role)
throws CmsRoleViolationException
The user must have the given role in at least one parent organizational unit.
cms - the opencms contextrole - the role to check
CmsRoleViolationException - if the user does not have the required role permissions
public void checkRoleForResource(CmsObject cms,
CmsRole role,
String resourceName)
throws CmsException,
CmsRoleViolationException
The user must have the given role in at least one organizational unit to which this resource belongs.
cms - the opencms contextrole - the role to checkresourceName - the name of the resource to check the role for
CmsRoleViolationException - if the user does not have the required role permissions
CmsException - if something goes wrong, while reading the resource
public List<CmsGroup> getManageableGroups(CmsObject cms,
String ouFqn,
boolean includeSubOus)
throws CmsException
CmsRole.ACCOUNT_MANAGER role.
cms - the current cms contextouFqn - the fully qualified name of the organizational unitincludeSubOus - if sub organizational units should be included in the search
CmsGroup objects
CmsException - if something goes wrong
public List<CmsResource> getManageableResources(CmsObject cms,
CmsRole role)
throws CmsException
cms - the current cms contextrole - the role to check
CmsResource objects
CmsException - if something goes wrong
public List<CmsUser> getManageableUsers(CmsObject cms,
String ouFqn,
boolean includeSubOus)
throws CmsException
CmsRole.ACCOUNT_MANAGER role.
cms - the current cms contextouFqn - the fully qualified name of the organizational unitincludeSubOus - if sub organizational units should be included in the search
CmsUser objects
CmsException - if something goes wrong
public List<CmsUser> getManageableUsers(CmsObject cms,
String ouFqn,
boolean includeSubOus,
boolean includeWebusers)
throws CmsException
CmsRole.ACCOUNT_MANAGER role.
cms - the current cms contextouFqn - the fully qualified name of the organizational unitincludeSubOus - if sub organizational units should be included in the searchincludeWebusers - if webuser organizational units should be included in the search
CmsUser objects
CmsException - if something goes wrong
public List<CmsOrganizationalUnit> getManageableOrgUnits(CmsObject cms,
String ouFqn,
boolean includeSubOus,
boolean includeWebusers)
throws CmsException
cms - the current CMS contextouFqn - the fully qualified name of the organizational unitincludeSubOus - if sub organizational units should be included in the searchincludeWebusers - if webuser organizational units should be included in the search
CmsException - if something goes wrong
public List<CmsOrganizationalUnit> getOrgUnitsForRole(CmsObject cms,
CmsRole role,
boolean includeSubOus)
throws CmsException
cms - the current cms contextrole - the role to checkincludeSubOus - if sub organizational units should be included in the search
CmsOrganizationalUnit objects
CmsException - if something goes wrong
public List<CmsRole> getRoles(CmsObject cms,
String ouFqn,
boolean includeSubOus)
throws CmsException
cms - the opencms contextouFqn - the fully qualified name of the organizational unit of the roleincludeSubOus - include roles of child organizational units
CmsRole objects
CmsException - if operation was not successful
public List<CmsRole> getRolesForResource(CmsObject cms,
String userFqn,
String resourceName)
throws CmsException
cms - the current cms contextuserFqn - the user name to checkresourceName - the resource name
CmsRole objects
CmsException - if something goes wrong
public List<CmsRole> getRolesOfUser(CmsObject cms,
String username,
String ouFqn,
boolean includeChildOus,
boolean directRolesOnly,
boolean recursive)
throws CmsException
cms - the opencms contextusername - the name of the user to get all roles forouFqn - the fully qualified name of the organizational unit to restrict the search toincludeChildOus - include roles of child organizational unitsdirectRolesOnly - if set only the direct assigned roles will be returned, if not also indirect rolesrecursive - if this is set, also roles of higher organizational unit are considered
CmsRole objects
CmsException - if operation was not successful
public List<CmsUser> getUsersOfRole(CmsObject cms,
CmsRole role,
boolean includeOtherOuUsers,
boolean directUsersOnly)
throws CmsException
Users that are "indirectly" in the role are not returned in the result.
cms - the opencms contextrole - the role to get all users forincludeOtherOuUsers - include users of other organizational unitsdirectUsersOnly - if set only the direct assigned users will be returned,
if not also indirect users, ie. members of child groups
CmsUser objects in the group
CmsException - if operation was not successful
public boolean hasRole(CmsObject cms,
CmsRole role)
cms - the opencms contextrole - the role to check
true if the given context user has the given role in the given organizational unit
public boolean hasRole(CmsObject cms,
String userName,
CmsRole role)
cms - the opencms contextuserName - the name of the user to check the role forrole - the role to check
true if the given user has the given role in the given organizational unit
public boolean hasRoleForResource(CmsObject cms,
CmsRole role,
String resourceName)
cms - the opencms contextrole - the role to checkresourceName - the name of the resource to check
true if the given context user has the given role for the given resource
public boolean hasRoleForResource(CmsObject cms,
String userName,
CmsRole role,
String resourceName)
cms - the opencms contextuserName - the name of the user to check the role forrole - the role to checkresourceName - the name of the resource to check
true if the given context user has the given role for the given resource
public void removeUserFromRole(CmsObject cms,
CmsRole role,
String username)
throws CmsException
cms - the opencms contextrole - the role to remove the user fromusername - the name of the user that is to be removed from the group
CmsException - if operation was not successful
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||