| Modifier and Type | Method and Description |
|---|---|
void |
auditTemporaryPermissions()
Removes temporary permissions that have expired
|
void |
clearMatching(Predicate<Node> test)
Clears any nodes from the holder which pass the predicate
|
void |
clearMatchingTransient(Predicate<Node> test)
Clears any transient nodes from the holder which pass the predicate
|
void |
clearMeta()
Clears all meta held by the object
|
void |
clearMeta(ContextSet contextSet)
Clears all meta held by the object in a specific context
|
void |
clearNodes()
Clears all nodes held by the object
|
void |
clearNodes(ContextSet contextSet)
Clears all nodes held by the object in a specific context
|
void |
clearParents()
Clears all parent groups
|
void |
clearParents(ContextSet contextSet)
Clears all parent groups in a specific context
|
void |
clearTransientNodes()
Clears all transient permissions the holder has.
|
Map<String,Boolean> |
exportNodes(Contexts contexts,
boolean lowerCase)
Converts the output of
getAllNodesFiltered(Contexts), and expands shorthand permissions. |
SortedSet<LocalizedNode> |
getAllNodes()
Gets a mutable sorted set of the nodes that this object has and inherits.
|
SortedSet<LocalizedNode> |
getAllNodes(Contexts contexts)
Gets a mutable sorted set of the nodes that this object has and inherits, filtered by context
|
Set<LocalizedNode> |
getAllNodesFiltered(Contexts contexts)
Gets a mutable set of the nodes that this object has and inherits, filtered by context.
|
CachedData |
getCachedData()
Gets the holders
CachedData cache. |
Set<? extends Node> |
getEnduringPermissions()
Similar to
getPermissions(), except without transient permissions. |
String |
getFriendlyName()
Gets a friendly name for this holder, to be displayed in command output, etc.
|
ImmutableSetMultimap<ImmutableContextSet,Node> |
getNodes()
Gets the backing multimap containing every permission this holder has.
|
String |
getObjectName()
Gets the objects name.
|
List<Node> |
getOwnNodes()
Gets a flattened/squashed view of the holders permissions.
|
Set<Node> |
getPermanentPermissionNodes()
Processes the nodes and returns the non-temporary ones.
|
SortedSet<? extends Node> |
getPermissions()
Gets a sorted set of all held permissions.
|
Set<Node> |
getTemporaryPermissionNodes()
Processes the nodes and returns the temporary ones.
|
ImmutableSetMultimap<ImmutableContextSet,Node> |
getTransientNodes()
Gets the backing multimap containing every transient permission this holder has.
|
Set<? extends Node> |
getTransientPermissions()
Similar to
getPermissions(), except without enduring permissions. |
Tristate |
hasPermission(Node node)
Checks to see if the object has a certain permission
|
Tristate |
hasPermission(Node node,
NodeEqualityPredicate equalityPredicate)
Checks to see if the object has a certain permission
|
Tristate |
hasTransientPermission(Node node)
Checks to see if the object has a certain permission
|
Tristate |
hasTransientPermission(Node node,
NodeEqualityPredicate equalityPredicate)
Checks to see if the object has a certain permission
|
boolean |
inheritsGroup(Group group)
Check to see if this holder inherits another group directly
|
boolean |
inheritsGroup(Group group,
ContextSet contextSet)
Check to see if this holder inherits another group directly
|
Tristate |
inheritsPermission(Node node)
Checks to see if the object inherits a certain permission
|
Tristate |
inheritsPermission(Node node,
NodeEqualityPredicate equalityPredicate)
Checks to see if the object inherits a certain permission
|
CompletableFuture<Void> |
refreshCachedData()
Refreshes and applies any changes to the cached holder data.
|
List<LocalizedNode> |
resolveInheritances()
Recursively resolves this holders permissions.
|
List<LocalizedNode> |
resolveInheritances(Contexts contexts)
Recursively resolves this holders permissions.
|
DataMutateResult |
setPermission(Node node)
Sets a permission for the object
|
default DataMutateResult |
setPermissionUnchecked(Node node)
Deprecated.
now forwards to
setPermission(Node). |
DataMutateResult |
setTransientPermission(Node node)
Sets a transient permission for the object
|
default DataMutateResult |
setTransientPermissionUnchecked(Node node)
Deprecated.
now forwards to
setTransientPermission(Node) |
DataMutateResult |
unsetPermission(Node node)
Unsets a permission for the object
|
default DataMutateResult |
unsetPermissionUnchecked(Node node)
Deprecated.
now forwards to
unsetPermission(Node) |
DataMutateResult |
unsetTransientPermission(Node node)
Unsets a transient permission for the object
|
default DataMutateResult |
unsetTransientPermissionUnchecked(Node node)
Deprecated.
now forwards to
unsetTransientPermission(Node) |
@Nonnull String getObjectName()
User.getUuid(), User.getName() or Group.getName() should normally be used instead of
this method.
@Nonnull String getFriendlyName()
This will always return a value, eventually falling back to getObjectName() if no
other "friendlier" identifiers are present.
@Nonnull CachedData getCachedData()
CachedData cache.@Nonnull CompletableFuture<Void> refreshCachedData()
Calling this method is unnecessary in most cases. Cache updates are handled behind the scenes by the implementation.
@Nonnull ImmutableSetMultimap<ImmutableContextSet,Node> getNodes()
This method does not resolve inheritance rules, and returns a view of what's 'in the file'.
@Nonnull ImmutableSetMultimap<ImmutableContextSet,Node> getTransientNodes()
This method does not resolve inheritance rules.
Transient permissions only exist for the duration of the session.
@Nonnull List<Node> getOwnNodes()
This list is constructed using the Multimap.values() method
of both the transient and enduring backing multimaps.
This means that it may contain duplicate entries.
Use getPermissions() for a view without duplicates.
@Nonnull SortedSet<? extends Node> getPermissions()
@Nonnull Set<? extends Node> getEnduringPermissions()
getPermissions(), except without transient permissions.
Unlike transient permissions, enduring permissions will be saved to storage, and exist after the session.
@Nonnull Set<? extends Node> getTransientPermissions()
getPermissions(), except without enduring permissions.
Transient permissions only exist for the duration of the session.
@Nonnull Set<Node> getPermanentPermissionNodes()
@Nonnull Set<Node> getTemporaryPermissionNodes()
@Nonnull List<LocalizedNode> resolveInheritances(Contexts contexts)
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.
contexts - the contexts for the lookup@Nonnull List<LocalizedNode> resolveInheritances()
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.
Unlike resolveInheritances(Contexts), this method does not
filter by context, at all.
@Nonnull SortedSet<LocalizedNode> getAllNodes(@Nonnull Contexts contexts)
Unlike getAllNodesFiltered(Contexts), this method will not filter individual nodes. The context is only
used to determine which groups should apply.
Nodes are sorted into priority order.
contexts - the context for the lookupNullPointerException - if the context is null@Nonnull SortedSet<LocalizedNode> getAllNodes()
Unlike getAllNodes(Contexts), this method does not filter by context, at all.
Nodes are sorted into priority order.
NullPointerException - if the context is null@Nonnull Set<LocalizedNode> getAllNodesFiltered(@Nonnull Contexts contexts)
Unlike getAllNodes(Contexts), this method WILL filter individual nodes, and only return ones that fully
meet the context provided.
contexts - the context for the lookupNullPointerException - if the context is null@Nonnull Map<String,Boolean> exportNodes(@Nonnull Contexts contexts, boolean lowerCase)
getAllNodesFiltered(Contexts), and expands shorthand permissions.contexts - the context for the lookuplowerCase - if the keys should be made lowercase whilst being exportedvoid auditTemporaryPermissions()
@Nonnull Tristate hasPermission(@Nonnull Node node, @Nonnull NodeEqualityPredicate equalityPredicate)
node - the node to check forequalityPredicate - how to determine if a node matchesNullPointerException - if the node is null@Nonnull Tristate hasTransientPermission(@Nonnull Node node, @Nonnull NodeEqualityPredicate equalityPredicate)
node - the node to check forequalityPredicate - how to determine if a node matchesNullPointerException - if the node is null@Nonnull Tristate inheritsPermission(@Nonnull Node node, @Nonnull NodeEqualityPredicate equalityPredicate)
node - the node to check forequalityPredicate - how to determine if a node matchesNullPointerException - if the node is null@Nonnull Tristate hasPermission(@Nonnull Node node)
node - the node to check forNullPointerException - if the node is null@Nonnull Tristate hasTransientPermission(@Nonnull Node node)
node - the node to check forNullPointerException - if the node is null@Nonnull Tristate inheritsPermission(@Nonnull Node node)
node - the node to check forNullPointerException - if the node is nullboolean inheritsGroup(@Nonnull Group group)
group - The group to check membership ofNullPointerException - if the group is nullIllegalStateException - if the group instance was not obtained from LuckPerms.boolean inheritsGroup(@Nonnull Group group, @Nonnull ContextSet contextSet)
group - The group to check membership ofcontextSet - the context set to filter byNullPointerException - if the group is nullIllegalStateException - if the group instance was not obtained from LuckPerms.@Nonnull DataMutateResult setPermission(@Nonnull Node node)
node - The node to be setNullPointerException - if the node is null@Nonnull DataMutateResult setTransientPermission(@Nonnull Node node)
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.
For unsetting a transient permission, see unsetTransientPermission(Node)
node - The node to be setNullPointerException - if the node is null@Nonnull DataMutateResult unsetPermission(@Nonnull Node node)
node - The node to be unsetNullPointerException - if the node is null@Nonnull DataMutateResult unsetTransientPermission(@Nonnull Node node)
node - The node to be unsetNullPointerException - if the node is nullvoid clearMatching(@Nonnull Predicate<Node> test)
test - the predicate to test for nodes which should be removedvoid clearMatchingTransient(@Nonnull Predicate<Node> test)
test - the predicate to test for nodes which should be removedvoid clearNodes()
void clearNodes(@Nonnull ContextSet contextSet)
contextSet - the contexts to filter byvoid clearParents()
void clearParents(@Nonnull ContextSet contextSet)
contextSet - the contexts to filter byvoid clearMeta()
void clearMeta(@Nonnull ContextSet contextSet)
contextSet - the contexts to filter byvoid clearTransientNodes()
@Nonnull @Deprecated default DataMutateResult setPermissionUnchecked(@Nonnull Node node)
setPermission(Node).node - The node to be setNullPointerException - if the node is null@Nonnull @Deprecated default DataMutateResult setTransientPermissionUnchecked(@Nonnull Node node)
setTransientPermission(Node)node - The node to be setNullPointerException - if the node is null@Nonnull @Deprecated default DataMutateResult unsetPermissionUnchecked(@Nonnull Node node)
unsetPermission(Node)node - The node to be unsetNullPointerException - if the node is null@Nonnull @Deprecated default DataMutateResult unsetTransientPermissionUnchecked(@Nonnull Node node)
unsetTransientPermission(Node)node - The node to be unsetNullPointerException - if the node is nullCopyright © 2018. All rights reserved.