|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.security.CmsRole
public final class CmsRole
A role is used in the OpenCms security system to check if a user has access to a certain system function.
Roles are used to ensure access permissions to system function that are not file based.
For example, roles are used to check permissions to functions like "the user can schedule a
job in the
" or "the user can export (or import)
the OpenCms database".CmsScheduleManager
All roles are based on
. This means to have access to a role,
the user has to be a member in a certain predefined system group. Each role has exactly one group that
contains all "direct" members of this role.CmsGroup
All roles have (optional) parent roles. If a user not a member of the role group of a role, but he is a member of at last one of the parent role groups, he/she also has full access to this role. This is called "indirect" membership to the role.
Please note that "indirect" membership does grant the user the same full access to a role that "direct"
membership does. For example, the
role is a parent group of all other roles.
So all users that are members of ROOT_ADMIN
have access to the functions of all other roles.ROOT_ADMIN
Please do not perform automated sorting of members on this compilation unit. That leads to NPE's
Field Summary | |
---|---|
static CmsRole |
ACCOUNT_MANAGER
The "ACCOUNT_MANAGER" role. |
static CmsRole |
ADMINISTRATOR
The "ADMINISTRATOR" role, which is a parent to all organizational unit roles. |
static CmsRole |
DATABASE_MANAGER
The "EXPORT_DATABASE" role. |
static CmsRole |
DEVELOPER
The "DEVELOPER" role. |
static java.lang.String |
PRINCIPAL_ROLE
Identifier for role principals. |
static CmsRole |
PROJECT_MANAGER
The "PROJECT_MANAGER" role. |
static CmsRole |
ROOT_ADMIN
The "ROOT_ADMIN" role, which is a parent to all other roles. |
static CmsRole |
VFS_MANAGER
The "VFS_MANAGER" role. |
static CmsRole |
WORKPLACE_MANAGER
The "WORKPLACE_MANAGER" role. |
static CmsRole |
WORKPLACE_USER
The "WORKPLACE_USER" role. |
Constructor Summary | |
---|---|
CmsRole(java.lang.String roleName,
CmsRole parentRole,
java.lang.String groupName,
boolean ouDependent)
Creates a user defined role. |
Method Summary | |
---|---|
CmsRoleViolationException |
createRoleViolationException(CmsRequestContext requestContext)
Returns a role violation exception configured with a localized, role specific message for this role. |
CmsRoleViolationException |
createRoleViolationExceptionForOrgUnit(CmsRequestContext requestContext,
java.lang.String orgUnitFqn)
Returns a role violation exception configured with a localized, role specific message for this role. |
CmsRoleViolationException |
createRoleViolationExceptionForResource(CmsRequestContext requestContext,
CmsResource resource)
Returns a role violation exception configured with a localized, role specific message for this role. |
boolean |
equals(java.lang.Object obj)
|
CmsRole |
forOrgUnit(java.lang.String ouFqn)
Creates a new role based on this one for the given organizational unit. |
java.util.List |
getChildren(boolean recursive)
Returns a list of all sub roles. |
java.lang.String |
getDescription(java.util.Locale locale)
Returns a localized role description. |
java.lang.String |
getDisplayName(CmsObject cms,
java.util.Locale locale)
Returns the display name of this role including the organizational unit. |
java.util.List |
getDistinctGroupNames()
Returns the distinct group names of this role. |
java.lang.String |
getFqn()
Returns the fully qualified name of this role. |
java.lang.String |
getGroupName()
Returns the name of the group this role is mapped to in the OpenCms database. |
CmsUUID |
getId()
Returns the id of this role. |
java.lang.String |
getName(java.util.Locale locale)
Returns a localized role name. |
java.lang.String |
getOuFqn()
Returns the fully qualified name of the organizational unit. |
CmsRole |
getParentRole()
Returns the parent role of this role. |
java.lang.String |
getRoleName()
Returns the name of the role. |
static java.util.List |
getSystemRoles()
Returns the list of system defined roles (instances of ). |
int |
getVirtualGroupFlags()
Returns the flags needed for a group to emulate this role. |
int |
hashCode()
|
boolean |
isOrganizationalUnitIndependent()
Checks if this role is organizational unit independent. |
boolean |
isSystemRole()
Check if this role is a system role. |
java.lang.String |
toString()
|
static CmsRole |
valueOf(CmsGroup group)
Returns the role for the given group. |
static CmsRole |
valueOfGroupName(java.lang.String groupName)
Returns the role for the given group name. |
static CmsRole |
valueOfId(CmsUUID roleId)
Returns the role for the given id. |
static CmsRole |
valueOfRoleName(java.lang.String roleName)
Returns the role for the given role name. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final CmsRole ACCOUNT_MANAGER
public static final CmsRole ADMINISTRATOR
public static final CmsRole DATABASE_MANAGER
public static final CmsRole DEVELOPER
public static final java.lang.String PRINCIPAL_ROLE
public static final CmsRole PROJECT_MANAGER
public static final CmsRole ROOT_ADMIN
public static final CmsRole VFS_MANAGER
public static final CmsRole WORKPLACE_MANAGER
public static final CmsRole WORKPLACE_USER
Constructor Detail |
---|
public CmsRole(java.lang.String roleName, CmsRole parentRole, java.lang.String groupName, boolean ouDependent)
roleName
- the name of this rolegroupName
- the name of the group the members of this role are stored inparentRole
- the parent role of this roleouDependent
- if the role is organizational unit dependentMethod Detail |
---|
public static java.util.List getSystemRoles()
CmsRole
).
public static CmsRole valueOf(CmsGroup group)
group
- a group to check for role representation
public static CmsRole valueOfGroupName(java.lang.String groupName)
groupName
- a group name to check for role representation
public static CmsRole valueOfId(CmsUUID roleId)
roleId
- the id to check for role representation
public static CmsRole valueOfRoleName(java.lang.String roleName)
roleName
- a role name to check for role representation
public CmsRoleViolationException createRoleViolationException(CmsRequestContext requestContext)
requestContext
- the current users OpenCms request context
public CmsRoleViolationException createRoleViolationExceptionForOrgUnit(CmsRequestContext requestContext, java.lang.String orgUnitFqn)
requestContext
- the current users OpenCms request contextorgUnitFqn
- the organizational unit used for the role check, it may be null
public CmsRoleViolationException createRoleViolationExceptionForResource(CmsRequestContext requestContext, CmsResource resource)
requestContext
- the current users OpenCms request contextresource
- the resource used for the role check, it may be null
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public CmsRole forOrgUnit(java.lang.String ouFqn)
ouFqn
- fully qualified name of the organizational unit
public java.util.List getChildren(boolean recursive)
recursive
- if not set just direct children are returned
CmsRole
objectspublic java.lang.String getDescription(java.util.Locale locale)
locale
- the locale
public java.lang.String getDisplayName(CmsObject cms, java.util.Locale locale) throws CmsException
cms
- the cms contextlocale
- the locale
CmsException
- if the organizational unit could not be readpublic java.util.List getDistinctGroupNames()
This group names are not fully qualified (organizational unit dependent).
public java.lang.String getFqn()
public java.lang.String getGroupName()
Here the fully qualified group name is returned.
public CmsUUID getId()
Does not differentiate for organizational units.
public java.lang.String getName(java.util.Locale locale)
locale
- the locale
public java.lang.String getOuFqn()
public CmsRole getParentRole()
public java.lang.String getRoleName()
public int getVirtualGroupFlags()
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean isOrganizationalUnitIndependent()
true
if this role is organizational unit independentpublic boolean isSystemRole()
true
if this role is a system rolepublic java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |