A user is assigned roles by being put into a group. However, the group membership only applies within some context, and so any roles for that user only apply within that context as well. For example, Sally is in the Sales Rep group for the Southern Region. That group gives Sally the right to edit user accounts within the Southern Region, but it does not allow her any rights in the Northern Region. So when Sally accesses some resource we will look through her groups finding roles. For each role we'll check if it applies to the resource type being accessed, and if so if that resource is within the context of the group membership. If so then the priviledges conveyed will be returned and used to determine whether to allow the request
Properties
| Property | Returns | Description |
|---|---|---|
| category | String | A grouping label used to organise roles when presenting them to admins, e.g. in the "add role to group" UI. Roles which don't override this fall into a single "General" catch-all category. |
| description | String | A short, human-readable summary of what this role grants, shown to administrators when assigning roles to a group. |
| name | String | The unique name of this role, used as the persisted identifier when a role is assigned to a group. This value must never change once the role is in use, since existing group-role assignments are keyed on it. |
Methods
getName()
Returns: String
The unique name of this role, used as the persisted identifier when a role is assigned to a group. This value must never change once the role is in use, since existing group-role assignments are keyed on it.
getDescription()
Returns: String
A short, human-readable summary of what this role grants, shown to administrators when assigning roles to a group.
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.
getCategory()
Returns: String
A grouping label used to organise roles when presenting them to admins, e.g. in the "add role to group" UI. Roles which don't override this fall into a single "General" catch-all category.