Interface UserPermission
- All Known Implementing Classes:
UserPermissionProvider
User permission interface to manage user permissions.
-
Method Summary
Modifier and TypeMethodDescriptionaddExpiredTime(int userId, String permission, long time) Adds an expired time to a permission.voidaddPermission(int userId, int creatorId, String permission, long time) Adds a permission to a user.voidclearPermission(int userId) Clears all permissions from a user.booleanexistsPermission(int userId, String permission) Checks if a permission exists.getCreatedDate(int userId, String permission) Obtains the created date of a permission.longgetCreatedTime(int userId, String permission) Obtains the created time of a permission.intgetCreatorId(int userId, String permission) Obtains the creator id of a permission.getExpiredDate(int userId, String permission) Obtains the expired date of a permission.longgetExpiredTime(int userId, String permission) Obtains the expired time of a permission.getPermissions(int userId) Obtains all permissions of a user.voidloadExpired(User user) Loads all expired permissions of a user.removeExpiredTime(int userId, String permission, long time) Removes an expired time from a permission.voidremovePermission(int userId, String permission) Removes a permission from a user.setExpiredTime(int userId, String permission, long time) Sets the expired time of a permission.
-
Method Details
-
existsPermission
Checks if a permission exists.- Parameters:
userId- The id of the user.permission- The permission.- Returns:
- True if the permission exists, otherwise false.
-
addPermission
Adds a permission to a user.- Parameters:
userId- The id of the user.creatorId- The id of the creator.permission- The permission.time- The time the permission was added.
-
removePermission
Removes a permission from a user.- Parameters:
userId- The id of the user.permission- The permission.
-
clearPermission
void clearPermission(int userId) Clears all permissions from a user.- Parameters:
userId- The id of the user.
-
getPermissions
Obtains all permissions of a user.- Parameters:
userId- The id of the user.- Returns:
- A list of all permissions of the user.
-
getCreatorId
Obtains the creator id of a permission.- Parameters:
userId- The id of the user.permission- The permission.- Returns:
- The creator id of the permission.
-
getCreatedTime
Obtains the created time of a permission.- Parameters:
userId- The id of the user.permission- The permission.- Returns:
- The created time of the permission.
-
getCreatedDate
Obtains the created date of a permission.- Parameters:
userId- The id of the user.permission- The permission.- Returns:
- The created date of the permission.
-
getExpiredTime
Obtains the expired time of a permission.- Parameters:
userId- The id of the user.permission- The permission.- Returns:
- The expired time of the permission.
-
getExpiredDate
Obtains the expired date of a permission.- Parameters:
userId- The id of the user.permission- The permission.- Returns:
- The expired date of the permission.
-
setExpiredTime
Sets the expired time of a permission.- Parameters:
userId- The id of the user.permission- The permission.time- The time the permission will expire.- Returns:
- The expired date of the permission.
-
addExpiredTime
Adds an expired time to a permission.- Parameters:
userId- The id of the user.permission- The permission.time- The time to add to the expired time.- Returns:
- The expired date of the permission.
-
removeExpiredTime
Removes an expired time from a permission.- Parameters:
userId- The id of the user.permission- The permission.time- The time to remove from the expired time.- Returns:
- The expired date of the permission.
-
loadExpired
Loads all expired permissions of a user.- Parameters:
user- The user.
-