Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- resolveGroupName(String)
- getName()
- addUserPermissions(UUID, Set)
- removeUserPermissions(UUID, Set)
- getUserPermissions(UUID)
- getUsersWithPermission(String)
- addUserPermissions(Collection, Set)
- removeUserPermissionFromAll(String)
- addGroupPermissions(String, Set)
- removeGroupPermissions(String, Set)
- getGroupPermissions(String)
- getGroupParent(String)
- getAllRegisteredGroups()
- getEffectiveGroupPermissions(String)
- addUserToGroup(UUID, String)
- removeUserFromGroup(UUID, String)
- getGroupsForUser(UUID)
- setUserGroup(UUID, String)
Class HytalePermissionsProvider
java.lang.Object
com.hypixel.hytale.server.core.util.io.BlockingDiskFile
com.hypixel.hytale.server.core.permissions.provider.HytalePermissionsProvider
- All Implemented Interfaces:
PermissionProvider
The basic vanilla handling of permissions using permissions.json.
This is never exposed anywhere - it's withheld and internal.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of the default group.The default group list.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringDeprecated.static final StringThe path to the permissions file. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGroupPermissions(String group, Set<String> permissions) Called to add a set of permissions to a group.addUserPermissions(Collection<UUID> uuids, Set<String> permissions) Adds the permissions to every user named.voidaddUserPermissions(UUID uuid, Set<String> permissions) Called to add a set of permissions to a user.voidaddUserToGroup(UUID uuid, String group) Called to add a user to a group.Resolves the full set of permissions for a group, including inherited permissions from the parent chain.getGroupParent(String group) getGroupPermissions(String group) Called to get the direct (non-inherited) set of permissions for a group.getGroupsForUser(UUID uuid) Called to get the set of groups a user is in.getName()getUserPermissions(UUID uuid) Called to get the set of permissions for a user.getUsersWithPermission(String permission) Finds the users that hold the permission as a grant of their own.voidremoveGroupPermissions(String group, Set<String> permissions) Called to remove a set of permissions from a group.voidremoveUserFromGroup(UUID uuid, String group) Called to remove a user from a group.removeUserPermissionFromAll(String permission) Takes the permission back from every user that holds it as a grant of their own, as one change.voidremoveUserPermissions(UUID uuid, Set<String> permissions) Called to remove a set of permissions from a user.static StringresolveGroupName(String group) Resolves a group name, mapping legacy names to the new namespaced equivalents.voidsetUserGroup(UUID uuid, String group) Atomically replaces all groups for a user with the given single group.Methods inherited from class BlockingDiskFile
syncLoad, syncSave
-
Field Details
-
GROUP_NONE
- See Also:
-
GROUP_ADVENTURER
- See Also:
-
GROUP_BUILDER
- See Also:
-
GROUP_WORLD_EDITOR
- See Also:
-
GROUP_SERVER_EDITOR
- See Also:
-
GROUP_ADMIN
- See Also:
-
DEFAULT_GROUP
-
OP_GROUP
Deprecated.UseGROUP_ADMINinstead. Kept for backward compatibility with op commands.The name of the operator group.- See Also:
-
DEFAULT_GROUP_LIST
-
PERMISSIONS_FILE_PATH
The path to the permissions file.- See Also:
-
-
Constructor Details
-
HytalePermissionsProvider
public HytalePermissionsProvider()Default Constructor for aHytalePermissionsProviderinstance. -
HytalePermissionsProvider
-
-
Method Details
-
resolveGroupName
-
getName
- Specified by:
getNamein interfacePermissionProvider- Returns:
- the name of the permission provider.
-
addUserPermissions
Description copied from interface:PermissionProviderCalled to add a set of permissions to a user.- Specified by:
addUserPermissionsin interfacePermissionProvider- Parameters:
uuid- TheUUIDof the user.permissions- The set of permissions to add.
-
removeUserPermissions
Description copied from interface:PermissionProviderCalled to remove a set of permissions from a user.- Specified by:
removeUserPermissionsin interfacePermissionProvider- Parameters:
uuid- TheUUIDof the user.permissions- The set of permissions to remove.
-
getUserPermissions
Description copied from interface:PermissionProviderCalled to get the set of permissions for a user.- Specified by:
getUserPermissionsin interfacePermissionProvider- Parameters:
uuid- TheUUIDof the user.- Returns:
- the set of permissions for the user.
-
getUsersWithPermission
Description copied from interface:PermissionProviderFinds the users that hold the permission as a grant of their own. A user who holds it through a group is not one of them, and neither is a user who holds it through a wildcard.This carries no default, because a provider that answers "nobody" when it means "I cannot tell" makes
PermissionProvider.removeUserPermissionFromAll(String)report that it revoked a permission that the user still holds.- Specified by:
getUsersWithPermissionin interfacePermissionProvider- Parameters:
permission- The permission node.- Returns:
- the users that were granted the permission.
-
addUserPermissions
@Nonnull public Set<UUID> addUserPermissions(@Nonnull Collection<UUID> uuids, @Nonnull Set<String> permissions) Description copied from interface:PermissionProviderAdds the permissions to every user named. Override this to store the change once rather than once for each user. The default adds them one user at a time, so a failure part way through leaves the users before it changed and reports none of them.- Specified by:
addUserPermissionsin interfacePermissionProvider- Parameters:
uuids- TheUUIDof each user.permissions- The set of permissions to add.- Returns:
- the users the permissions were added to, which leaves out the users that held them.
-
removeUserPermissionFromAll
Description copied from interface:PermissionProviderTakes the permission back from every user that holds it as a grant of their own, as one change. A user who holds it through a group keeps it.- Specified by:
removeUserPermissionFromAllin interfacePermissionProvider- Parameters:
permission- The permission node.- Returns:
- the users the permission was taken from.
-
addGroupPermissions
Description copied from interface:PermissionProviderCalled to add a set of permissions to a group.- Specified by:
addGroupPermissionsin interfacePermissionProvider- Parameters:
group- The name of the group.permissions- The set of permissions to add.
-
removeGroupPermissions
Description copied from interface:PermissionProviderCalled to remove a set of permissions from a group.- Specified by:
removeGroupPermissionsin interfacePermissionProvider- Parameters:
group- The name of the group.permissions- The set of permissions to remove.
-
getGroupPermissions
Description copied from interface:PermissionProviderCalled to get the direct (non-inherited) set of permissions for a group.- Specified by:
getGroupPermissionsin interfacePermissionProvider- Parameters:
group- The name of the group.- Returns:
- the set of permissions for the group.
-
getGroupParent
- Specified by:
getGroupParentin interfacePermissionProvider- Parameters:
group- The name of the group.- Returns:
- the parent group name, or
nullif this group has no parent.
-
getAllRegisteredGroups
- Specified by:
getAllRegisteredGroupsin interfacePermissionProvider- Returns:
- all group names known to this provider.
-
getEffectiveGroupPermissions
Description copied from interface:PermissionProviderResolves the full set of permissions for a group, including inherited permissions from the parent chain. Implementations must protect against cycles.- Specified by:
getEffectiveGroupPermissionsin interfacePermissionProvider- Parameters:
group- The name of the group.- Returns:
- the effective permission set (direct + inherited).
-
addUserToGroup
Description copied from interface:PermissionProviderCalled to add a user to a group.- Specified by:
addUserToGroupin interfacePermissionProvider- Parameters:
uuid- TheUUIDof the user.group- The name of the group.
-
removeUserFromGroup
Description copied from interface:PermissionProviderCalled to remove a user from a group.- Specified by:
removeUserFromGroupin interfacePermissionProvider- Parameters:
uuid- TheUUIDof the user.group- The name of the group.
-
getGroupsForUser
Description copied from interface:PermissionProviderCalled to get the set of groups a user is in.- Specified by:
getGroupsForUserin interfacePermissionProvider- Parameters:
uuid- TheUUIDof the user.- Returns:
- the set of groups the user is in.
-
setUserGroup
Description copied from interface:PermissionProviderAtomically replaces all groups for a user with the given single group.- Specified by:
setUserGroupin interfacePermissionProvider- Parameters:
uuid- TheUUIDof the user.group- The group to set as the user's sole group.
-
GROUP_ADMINinstead.