public interface PermissionService
Modifier and Type | Field and Description |
---|---|
static String |
SUBJECTS_COMMAND_BLOCK |
static String |
SUBJECTS_GROUP |
static String |
SUBJECTS_ROLE_TEMPLATE |
static String |
SUBJECTS_SYSTEM |
static String |
SUBJECTS_USER |
Modifier and Type | Method and Description |
---|---|
SubjectData |
getDefaultData()
This is a transient data object that contains data that will be applied
by default to all subjects.
|
Optional<PermissionDescription> |
getDescription(String permission)
Gets the registered or generated
PermissionDescription for the
given permission if available. |
Collection<PermissionDescription> |
getDescriptions()
Gets a immutable collection containing all registered or generated
PermissionDescription s. |
SubjectCollection |
getGroupSubjects()
Returns the collection of group subjects available.
|
Map<String,SubjectCollection> |
getKnownSubjects()
Returns an immutable copy of the mapping of all subject collections
stored by this permission service.
|
SubjectCollection |
getSubjects(String identifier)
Returns a subject collection with the given identifier.
|
SubjectCollection |
getUserSubjects()
Returns the permissions level that describes users.
|
Optional<PermissionDescription.Builder> |
newDescriptionBuilder(Object plugin)
Creates a new description builder for the given plugin's permission.
|
void |
registerContextCalculator(ContextCalculator calculator)
Register a function that calculates contexts relevant to a given user at
the time the function is called.
|
static final String SUBJECTS_USER
static final String SUBJECTS_GROUP
static final String SUBJECTS_SYSTEM
static final String SUBJECTS_COMMAND_BLOCK
static final String SUBJECTS_ROLE_TEMPLATE
SubjectCollection getUserSubjects()
SubjectCollection getGroupSubjects()
SubjectData getDefaultData()
SubjectCollection getSubjects(String identifier)
identifier
- The identifierMap<String,SubjectCollection> getKnownSubjects()
void registerContextCalculator(ContextCalculator calculator)
calculator
- The context calculator to registerOptional<PermissionDescription.Builder> newDescriptionBuilder(Object plugin)
Optional.absent()
if the service does not support
PermissionDescription
s.plugin
- The plugin to create permission descriptions forOptional<PermissionDescription> getDescription(String permission)
PermissionDescription
for the
given permission if available. If the given permission is not defined
itself this might also return the associated permission template.permission
- The permission to get the description forOptional.absent()
Collection<PermissionDescription> getDescriptions()
PermissionDescription
s.