Interface DefaultSynchronizedPermissionManagement
-
- All Superinterfaces:
IPermissionManagement
public interface DefaultSynchronizedPermissionManagement extends IPermissionManagement
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default IPermissionGroupaddGroup(@NotNull IPermissionGroup permissionGroup)Adds a new permission group to the list of groups.default IPermissionGroupaddGroup(@NotNull java.lang.String role, int potency)default IPermissionUseraddUser(@NotNull IPermissionUser permissionUser)Adds a new user to the database.default IPermissionUseraddUser(@NotNull java.lang.String name, @NotNull java.lang.String password, int potency)default booleancontainsGroup(@NotNull java.lang.String group)Checks if a specific group exists.default booleancontainsUser(@NotNull java.lang.String name)Checks if at least one user with the given name is stored in the database.default booleancontainsUser(@NotNull java.util.UUID uniqueId)Checks if a user with the given uniqueId is stored in the database.default voiddeleteGroup(@NotNull IPermissionGroup permissionGroup)Deletes a group by its name out of the list of groups.default voiddeleteGroup(@NotNull java.lang.String name)Deletes a group by its name out of the list of groups.default booleandeleteUser(@NotNull IPermissionUser permissionUser)Deletes one user with the uniqueId of the given user.default booleandeleteUser(@NotNull java.lang.String name)Deletes all users in the database matching the given name.default IPermissionGroupgetDefaultPermissionGroup()default IPermissionUsergetFirstUser(java.lang.String name)default @Nullable IPermissionGroupgetGroup(@NotNull java.lang.String name)Gets a specific group by its name.default @Nullable IPermissionUsergetUser(@NotNull java.util.UUID uniqueId)Gets a user with the given uniqueId out of the database.default java.util.Collection<IPermissionUser>getUsers()Gets a list of all users stored in the database.default @NotNull java.util.List<IPermissionUser>getUsers(@NotNull java.lang.String name)Gets a list of all users with the given name out of the database.default java.util.Collection<IPermissionUser>getUsersByGroup(@NotNull java.lang.String group)Gets a list of all users stored in the database with the given group.default voidsetGroups(java.util.Collection<? extends IPermissionGroup> groups)Clears all groups in the Cloud and sets given groups.default voidsetUsers(@Nullable java.util.Collection<? extends IPermissionUser> users)Clears all users stored in the database and inserts the given list.default voidupdateGroup(@NotNull IPermissionGroup permissionGroup)Updates a permission group in the list of groups.default voidupdateUser(@NotNull IPermissionUser permissionUser)Updates an already existing user in the database.-
Methods inherited from interface de.dytanic.cloudnet.driver.permission.IPermissionManagement
addGroupAsync, addGroupAsync, addUserAsync, addUserAsync, canBeOverwritten, containsGroupAsync, containsUserAsync, containsUserAsync, deleteGroupAsync, deleteGroupAsync, deleteUserAsync, deleteUserAsync, getAllPermissions, getAllPermissions, getChildPermissionManagement, getDefaultPermissionGroupAsync, getExtendedGroups, getFirstUserAsync, getGroupAsync, getGroups, getGroups, getGroupsAsync, getGroupsAsync, getHighestPermissionGroup, getPermissionResult, getPermissionResult, getPermissionResult, getUser, getUserAsync, getUsersAsync, getUsersAsync, getUsersByGroupAsync, hasPermission, hasPermission, hasPermission, reload, setGroupsAsync, setUsersAsync, testPermissible, testPermissionGroup, testPermissionUser, updateGroupAsync, updateUserAsync
-
-
-
-
Method Detail
-
getFirstUser
default IPermissionUser getFirstUser(java.lang.String name)
- Specified by:
getFirstUserin interfaceIPermissionManagement
-
getDefaultPermissionGroup
default IPermissionGroup getDefaultPermissionGroup()
- Specified by:
getDefaultPermissionGroupin interfaceIPermissionManagement
-
addUser
default IPermissionUser addUser(@NotNull @NotNull java.lang.String name, @NotNull @NotNull java.lang.String password, int potency)
- Specified by:
addUserin interfaceIPermissionManagement
-
addGroup
default IPermissionGroup addGroup(@NotNull @NotNull java.lang.String role, int potency)
- Specified by:
addGroupin interfaceIPermissionManagement
-
addUser
default IPermissionUser addUser(@NotNull @NotNull IPermissionUser permissionUser)
Description copied from interface:IPermissionManagementAdds a new user to the database.- Specified by:
addUserin interfaceIPermissionManagement- Parameters:
permissionUser- the user to be added- Returns:
- the new user
-
updateUser
default void updateUser(@NotNull @NotNull IPermissionUser permissionUser)Description copied from interface:IPermissionManagementUpdates an already existing user in the database.- Specified by:
updateUserin interfaceIPermissionManagement- Parameters:
permissionUser- the user to be updated
-
deleteUser
default boolean deleteUser(@NotNull @NotNull java.lang.String name)Description copied from interface:IPermissionManagementDeletes all users in the database matching the given name. This method is case-sensitive.- Specified by:
deleteUserin interfaceIPermissionManagement- Parameters:
name- the name of the users to be deleted
-
deleteUser
default boolean deleteUser(@NotNull @NotNull IPermissionUser permissionUser)Description copied from interface:IPermissionManagementDeletes one user with the uniqueId of the given user.- Specified by:
deleteUserin interfaceIPermissionManagement- Parameters:
permissionUser- the user to be deleted
-
containsUser
default boolean containsUser(@NotNull @NotNull java.util.UUID uniqueId)Description copied from interface:IPermissionManagementChecks if a user with the given uniqueId is stored in the database.- Specified by:
containsUserin interfaceIPermissionManagement- Parameters:
uniqueId- the uniqueId of the user- Returns:
trueif there is a user with that uniqueId,falseotherwise
-
containsUser
default boolean containsUser(@NotNull @NotNull java.lang.String name)Description copied from interface:IPermissionManagementChecks if at least one user with the given name is stored in the database. This method is case-sensitive.- Specified by:
containsUserin interfaceIPermissionManagement- Parameters:
name- the name of the user- Returns:
trueif there is a user with that name,falseotherwise
-
getUser
@Nullable default @Nullable IPermissionUser getUser(@NotNull @NotNull java.util.UUID uniqueId)
Description copied from interface:IPermissionManagementGets a user with the given uniqueId out of the database.- Specified by:
getUserin interfaceIPermissionManagement- Parameters:
uniqueId- the uniqueId of the user- Returns:
- the
IPermissionUserfrom the database ornullif there is no user with that uniqueId stored
-
getUsers
@NotNull default @NotNull java.util.List<IPermissionUser> getUsers(@NotNull @NotNull java.lang.String name)
Description copied from interface:IPermissionManagementGets a list of all users with the given name out of the database. This can only return null when the connection to the database (or when it is executed in a Wrapper instance the connection to the cloud) times out.- Specified by:
getUsersin interfaceIPermissionManagement- Parameters:
name- the name of the users- Returns:
- a list of all
IPermissionUsers stored in the database or an empty list if there is no user with that name stored.
-
getUsers
default java.util.Collection<IPermissionUser> getUsers()
Description copied from interface:IPermissionManagementGets a list of all users stored in the database. This can only return null when the connection to the database (or when it is executed in a Wrapper instance the connection to the cloud) times out.This method shouldn't be used when there are many users stored in the database, because that takes a lot of memory.
- Specified by:
getUsersin interfaceIPermissionManagement- Returns:
- a list of all
IPermissionUsers stored in the database or an empty list if there is no user with that name stored.
-
setUsers
default void setUsers(@Nullable @Nullable java.util.Collection<? extends IPermissionUser> users)Description copied from interface:IPermissionManagementClears all users stored in the database and inserts the given list.- Specified by:
setUsersin interfaceIPermissionManagement- Parameters:
users- the newIPermissionUsers to be stored in the database
-
getUsersByGroup
default java.util.Collection<IPermissionUser> getUsersByGroup(@NotNull @NotNull java.lang.String group)
Description copied from interface:IPermissionManagementGets a list of all users stored in the database with the given group. This can only return null when the connection to the database (or when it is executed in a Wrapper instance the connection to the cloud) times out.This method shouldn't be used when there are many users with that group stored in the database, because that takes a lot of memory.
- Specified by:
getUsersByGroupin interfaceIPermissionManagement- Returns:
- a list of all
IPermissionUsers stored in the database or an empty list if there is no user with that name stored.
-
addGroup
default IPermissionGroup addGroup(@NotNull @NotNull IPermissionGroup permissionGroup)
Description copied from interface:IPermissionManagementAdds a new permission group to the list of groups. If a group with that name already exists, it will be deleted and created again.- Specified by:
addGroupin interfaceIPermissionManagement- Parameters:
permissionGroup- theIPermissionGroupto be added- Returns:
- the new group
-
updateGroup
default void updateGroup(@NotNull @NotNull IPermissionGroup permissionGroup)Description copied from interface:IPermissionManagementUpdates a permission group in the list of groups. If a group with that name doesn't exist, it will be created.- Specified by:
updateGroupin interfaceIPermissionManagement- Parameters:
permissionGroup- theIPermissionGroupto be updated
-
deleteGroup
default void deleteGroup(@NotNull @NotNull java.lang.String name)Description copied from interface:IPermissionManagementDeletes a group by its name out of the list of groups. If a group with that name doesn't exist, nothing happens.- Specified by:
deleteGroupin interfaceIPermissionManagement- Parameters:
name- the case-sensitive name of the group
-
deleteGroup
default void deleteGroup(@NotNull @NotNull IPermissionGroup permissionGroup)Description copied from interface:IPermissionManagementDeletes a group by its name out of the list of groups. If a group with that name doesn't exist, nothing happens.- Specified by:
deleteGroupin interfaceIPermissionManagement- Parameters:
permissionGroup- theIPermissionGroupto be deleted
-
containsGroup
default boolean containsGroup(@NotNull @NotNull java.lang.String group)Description copied from interface:IPermissionManagementChecks if a specific group exists.- Specified by:
containsGroupin interfaceIPermissionManagement- Parameters:
group- the case-sensitive name of the group- Returns:
trueif the group exists,falseotherwise
-
getGroup
@Nullable default @Nullable IPermissionGroup getGroup(@NotNull @NotNull java.lang.String name)
Description copied from interface:IPermissionManagementGets a specific group by its name.- Specified by:
getGroupin interfaceIPermissionManagement- Parameters:
name- the case-sensitive name of the group- Returns:
- the
IPermissionUserif it exists,nullotherwise
-
setGroups
default void setGroups(java.util.Collection<? extends IPermissionGroup> groups)
Description copied from interface:IPermissionManagementClears all groups in the Cloud and sets given groups.- Specified by:
setGroupsin interfaceIPermissionManagement- Parameters:
groups- the new groups
-
-