| 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. |
@NonNull NodeMap |
getData(@NonNull DataType dataType)
Gets the
NodeMap of a particular type. |
@NonNull SortedSet<Node> |
getDistinctNodes()
Gets a flattened and sorted view of the holders own distinct
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<Group> |
getInheritedGroups(@NonNull QueryOptions queryOptions)
Gets a collection of the
Groups this holder inherits nodes from. |
default @NonNull Collection<Node> |
getNodes()
Gets a flattened view of the holders own
Nodes. |
default <T extends Node> |
getNodes(@NonNull NodeType<T> type)
Gets a flattened view of the holders own
Nodes of the given type. |
@NonNull QueryOptions |
getQueryOptions()
Gets the most appropriate query options available at the time for the
PermissionHolder. |
@NonNull SortedSet<Node> |
resolveDistinctInheritedNodes(@NonNull QueryOptions queryOptions)
Gets a resolved and sorted view of the holders own and inherited distinct
Nodes. |
default <T extends Node> |
resolveInheritedNodes(@NonNull NodeType<T> type,
@NonNull QueryOptions queryOptions)
Gets a resolved view of the holders own and inherited
Nodes of a given type. |
@NonNull Collection<Node> |
resolveInheritedNodes(@NonNull QueryOptions queryOptions)
Gets a resolved view of the holders own and inherited
Nodes. |
@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 QueryOptions getQueryOptions()
PermissionHolder.
For Users, the most appropriate query options will be their
current active query options if the
corresponding player is online, and otherwise, will fallback to
the current static query options
if they are offline.
For Groups, the most appropriate query options will always be
ContextManager.getStaticQueryOptions() the current static query options.
@NonNull CachedDataManager getCachedData()
CachedDataManager cache.@NonNull 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.
default @NonNull Collection<Node> getNodes()
Nodes.
This list is constructed using the values of both the normal
and transient backing node maps.
It may contain duplicate entries if the same node is added to both the normal
and transient node maps. You can use getDistinctNodes() for a view without
duplicates.
This method does not resolve inheritance rules.
default <T extends Node> @NonNull Collection<T> getNodes(@NonNull NodeType<T> type)
Nodes of the given type.T - the node typetype - the type of node to filter bygetNodes()@NonNull SortedSet<Node> getDistinctNodes()
Nodes.
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)
Nodes.
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 optionsdefault <T extends Node> @NonNull Collection<T> resolveInheritedNodes(@NonNull NodeType<T> type, @NonNull QueryOptions queryOptions)
Nodes of a given type.T - the node typetype - the type of node to filter byqueryOptions - the query optionsresolveInheritedNodes(QueryOptions)@NonNull SortedSet<Node> resolveDistinctInheritedNodes(@NonNull QueryOptions queryOptions)
Nodes.
Effectively a sorted version of resolveInheritedNodes(QueryOptions),
without duplicates. Use the aforementioned method if you don't require either of these
attributes.
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 Collection<Group> getInheritedGroups(@NonNull QueryOptions queryOptions)
Groups this holder inherits nodes from.
If Flag.RESOLVE_INHERITANCE is set, this will include holders inherited from both
directly and indirectly (through directly inherited groups). It will effectively resolve the
whole "inheritance tree".
If Flag.RESOLVE_INHERITANCE is not set, then the traversal will only go one
level up the inheritance tree, and return only directly inherited groups.
The collection will be ordered according to the platforms inheritance rules. The groups which are inherited from first will appear earlier in the list.
The list will not contain the holder.
queryOptions - the query optionsvoid 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.