| Modifier and Type | Interface and Description |
|---|---|
static interface |
PermissionHolder.Identifier
Represents a way to identify distinct
PermissionHolders. |
| Modifier and Type | Method and Description |
|---|---|
void |
auditTemporaryNodes()
Removes any temporary permissions that have expired.
|
@NonNull NodeMap |
data()
Gets the holders
DataType.NORMAL data. |
@NonNull CachedDataManager |
getCachedData()
Gets the holders
CachedDataManager cache. |
NodeMap |
getData(@NonNull DataType dataType)
Gets the
NodeMap of a particular type. |
@NonNull SortedSet<Node> |
getDistinctNodes()
Gets a sorted set of all held nodes.
|
@NonNull String |
getFriendlyName()
Gets a friendly name for this holder, to be displayed in command output, etc.
|
@NonNull PermissionHolder.Identifier |
getIdentifier()
Gets the identifier of the holder.
|
@NonNull Collection<Node> |
getNodes()
Gets a flattened/squashed view of the holders permissions.
|
@NonNull SortedSet<Node> |
resolveDistinctInheritedNodes(@NonNull QueryOptions queryOptions)
Gets a mutable sorted set of the nodes that this object has and inherits, filtered by context
|
@NonNull Collection<Node> |
resolveInheritedNodes(@NonNull QueryOptions queryOptions)
Recursively resolves this holders permissions.
|
@NonNull NodeMap |
transientData()
Gets the holders
DataType.TRANSIENT data. |
@NonNull PermissionHolder.Identifier getIdentifier()
@NonNull String getFriendlyName()
This will always return a value, eventually falling back to
PermissionHolder.Identifier.getName() if no other "friendlier" identifiers are present.
For Users, this method will attempt to return the username,
before falling back to PermissionHolder.Identifier.getName().
For Groups, this method will attempt to return the groups display name, before
falling back to PermissionHolder.Identifier.getName().
@NonNull CachedDataManager getCachedData()
CachedDataManager cache.NodeMap getData(@NonNull DataType dataType)
NodeMap of a particular type.dataType - the data type@NonNull NodeMap data()
DataType.NORMAL data.@NonNull NodeMap transientData()
DataType.TRANSIENT data.
Transient permissions only exist for the duration of the session.
A transient node is a permission that does not persist. Whenever a user logs out of the server, or the server restarts, this permission will disappear. It is never saved to the datastore, and therefore will not apply on other servers.
This is useful if you want to temporarily set a permission for a user while they're online, but don't want it to persist, and have to worry about removing it when they log out.
@NonNull Collection<Node> getNodes()
This list is constructed using the values of both the transient and enduring backing multimaps.
This means that it may contain duplicate entries.
Use getDistinctNodes() for a view without duplicates.
This method does not resolve inheritance rules.
@NonNull SortedSet<Node> getDistinctNodes()
Effectively a sorted version of getNodes(), without duplicates. Use the
aforementioned method if you don't require either of these attributes.
This method does not resolve inheritance rules.
@NonNull Collection<Node> resolveInheritedNodes(@NonNull QueryOptions queryOptions)
The returned list will contain every inherited node the holder has, in the order that they were inherited in.
This means the list will contain duplicates.
Inheritance is performed according to the platforms rules, and the order will vary depending on the accumulation order. By default, the holders own nodes are first in the list, with the entries from the end of the inheritance tree appearing last.
queryOptions - the query options@NonNull SortedSet<Node> resolveDistinctInheritedNodes(@NonNull QueryOptions queryOptions)
Nodes are sorted into priority order. The order of inheritance is only important during the process of flattening inherited entries.
queryOptions - the query optionsNullPointerException - if the context is nullvoid auditTemporaryNodes()
This method is called periodically by the platform, so it is only necessary to run if you want to guarantee that the current data is totally up-to-date.