public interface PermissionDescription
PermissionService
, but the registration does not
have any impact on the results of the permission checks of the service.Modifier and Type | Interface and Description |
---|---|
static interface |
PermissionDescription.Builder
A builder for permission descriptions.
|
Modifier and Type | Field and Description |
---|---|
static String |
ROLE_ADMIN
The admin role should be assigned to everyone who should have full access
permissions.
|
static String |
ROLE_STAFF
The staff role should be assigned to everyone who should have elevated
access permissions.
|
static String |
ROLE_USER
The user role should be assigned to everyone who should have basic access
permissions.
|
Modifier and Type | Method and Description |
---|---|
Map<Subject,Boolean> |
getAssignedSubjects(String type)
Get all subjects that have this permission set.
|
Text |
getDescription()
Gets a short description of the linked permission.
|
String |
getId()
Gets the permission id this description belongs too.
|
PluginContainer |
getOwner()
Gets the owning plugin the permission belongs to.
|
static final String ROLE_USER
static final String ROLE_STAFF
static final String ROLE_ADMIN
String getId()
The permission id must be of the specified format as specified using EBNF:
The following examples shall help you to structure your permissions well:
So if you want to allow someone to give themself only DIAMONDs, you would assign them the following permissions:
Note: Permission ids are case insensitive! Permission ids should start with the owning plugin's id.
Text getDescription()
Map<Subject,Boolean> getAssignedSubjects(String type)
If you want to know to which role-templates this permission is
assigned use PermissionService.SUBJECTS_ROLE_TEMPLATE
.
type
- The subject type identifier to useSubjectCollection.getAllWithPermission(String)
PluginContainer getOwner()