Security role declared by an app in controllers.xml, granting a set of privileges over the app's controller resources. Each role names the privileges it grants and, optionally, the controller resource types it applies to. A role applies to a controller resource when the resource carries one of the role's types, or when the role declares no types at all, and the resource sits within the organisation or website the group membership was granted on.
Implements: Role, Serializable
Properties
| Property | Returns | Description |
|---|---|---|
| category | String | Category the role is grouped under in the role picker. |
| description | String | Description of the role shown to administrators when they assign it to a group. |
| name | String | Name of the role as declared in controllers.xml. This is what group memberships refer to when granting the role. |
| privs | Set<Priviledge> | Privileges this role grants, parsed from the privilege names declared in controllers.xml. The parsed set is computed once and then cached, so repeated calls are cheap. |
| resourceTypes | Set<String> | Controller resource types this role is limited to. When empty or null the role applies to every controller resource of the app. |
Inherited from Role
Methods
canConnectToOrganisation()
Returns: boolean
Convenience method for callers, such as Velocity templates, which just need to know if this role can be assigned within an organisation context, without dealing with the TargetType enum directly.
canConnectToRepository()
Returns: boolean
Convenience method for callers, such as Velocity templates, which just need to know if this role can be assigned within a repository (or website) context, without dealing with the TargetType enum directly.
Methods
getName()
Returns: String
Name of the role as declared in controllers.xml. This is what group memberships refer to when granting the role.
getResourceTypes()
Returns: Set<String>
Controller resource types this role is limited to. When empty or null the role applies to every controller resource of the app.
getPrivs()
Returns: Set<Priviledge>
Privileges this role grants, parsed from the privilege names declared in controllers.xml. The parsed set is computed once and then cached, so repeated calls are cheap.
getDescription()
Returns: String
Description of the role shown to administrators when they assign it to a group.
getCategory()
Returns: String
Category the role is grouped under in the role picker.
canConnectTo(TargetType type)
Returns: boolean
Whether this role may be granted against the given kind of target. App roles always return true, so they can be granted anywhere.
| Parameter | Description |
|---|---|
type | the kind of target the role would be granted on |