Class UserPermissionProvider
java.lang.Object
de.murmelmeister.murmelapi.user.permission.UserPermissionProvider
- All Implemented Interfaces:
UserPermission
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
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.private voidcreateTable(String tableName) 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.
-
Field Details
-
dateFormat
-
-
Constructor Details
-
UserPermissionProvider
public UserPermissionProvider()
-
-
Method Details
-
createTable
-
existsPermission
Description copied from interface:UserPermissionChecks if a permission exists.- Specified by:
existsPermissionin interfaceUserPermission- Parameters:
userId- The id of the user.permission- The permission.- Returns:
- True if the permission exists, otherwise false.
-
addPermission
Description copied from interface:UserPermissionAdds a permission to a user.- Specified by:
addPermissionin interfaceUserPermission- Parameters:
userId- The id of the user.creatorId- The id of the creator.permission- The permission.time- The time the permission was added.
-
removePermission
Description copied from interface:UserPermissionRemoves a permission from a user.- Specified by:
removePermissionin interfaceUserPermission- Parameters:
userId- The id of the user.permission- The permission.
-
clearPermission
public void clearPermission(int userId) Description copied from interface:UserPermissionClears all permissions from a user.- Specified by:
clearPermissionin interfaceUserPermission- Parameters:
userId- The id of the user.
-
getPermissions
Description copied from interface:UserPermissionObtains all permissions of a user.- Specified by:
getPermissionsin interfaceUserPermission- Parameters:
userId- The id of the user.- Returns:
- A list of all permissions of the user.
-
getCreatorId
Description copied from interface:UserPermissionObtains the creator id of a permission.- Specified by:
getCreatorIdin interfaceUserPermission- Parameters:
userId- The id of the user.permission- The permission.- Returns:
- The creator id of the permission.
-
getCreatedTime
Description copied from interface:UserPermissionObtains the created time of a permission.- Specified by:
getCreatedTimein interfaceUserPermission- Parameters:
userId- The id of the user.permission- The permission.- Returns:
- The created time of the permission.
-
getCreatedDate
Description copied from interface:UserPermissionObtains the created date of a permission.- Specified by:
getCreatedDatein interfaceUserPermission- Parameters:
userId- The id of the user.permission- The permission.- Returns:
- The created date of the permission.
-
getExpiredTime
Description copied from interface:UserPermissionObtains the expired time of a permission.- Specified by:
getExpiredTimein interfaceUserPermission- Parameters:
userId- The id of the user.permission- The permission.- Returns:
- The expired time of the permission.
-
getExpiredDate
Description copied from interface:UserPermissionObtains the expired date of a permission.- Specified by:
getExpiredDatein interfaceUserPermission- Parameters:
userId- The id of the user.permission- The permission.- Returns:
- The expired date of the permission.
-
setExpiredTime
Description copied from interface:UserPermissionSets the expired time of a permission.- Specified by:
setExpiredTimein interfaceUserPermission- 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
Description copied from interface:UserPermissionAdds an expired time to a permission.- Specified by:
addExpiredTimein interfaceUserPermission- 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
Description copied from interface:UserPermissionRemoves an expired time from a permission.- Specified by:
removeExpiredTimein interfaceUserPermission- 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
Description copied from interface:UserPermissionLoads all expired permissions of a user.- Specified by:
loadExpiredin interfaceUserPermission- Parameters:
user- The user.
-