public static interface PermissionDescription.Builder
Modifier and Type | Method and Description |
---|---|
PermissionDescription.Builder |
assign(String role,
boolean value)
Assigns this permission to the given role-template
Subject . |
PermissionDescription.Builder |
description(Text description)
Sets the short description to use.
|
PermissionDescription.Builder |
id(String permissionId)
Sets the permission id for the description this builder creates.
|
PermissionDescription |
register()
Creates and registers a new
PermissionDescription instance
with the given settings. |
PermissionDescription.Builder id(String permissionId)
PermissionDescription.getId()
for format specifications.permissionId
- The permission idPermissionDescription.Builder description(Text description)
description
- The short description to usePermissionDescription.Builder assign(String role, boolean value)
Subject
.
If the given subject does not exist it will be created. It is
recommended to use the role suggestions provided
by PermissionDescription
. Please
do not assign a permission to user, staff and admin at the same time
but solve this with subject inheritance if possible.
Note: The permissions are only assigned during
register()
. Permission templates should not be assigned to
anyone.
role
- The role-template to assign the permission to. See
constants in PermissionDescription
for common roles
(not exhaustive).value
- The value to to assignPermissionDescription register() throws IllegalStateException
PermissionDescription
instance
with the given settings.IllegalStateException
- If there are any settings left unset or
a description with the given permission id was already
registered and the PermissionService
does not support
overwriting descriptions