Record Class PermissionProvider
java.lang.Object
java.lang.Record
de.murmelmeister.murmelapi.permission.PermissionProvider
- All Implemented Interfaces:
Permission
-
Constructor Summary
ConstructorsConstructorDescriptionPermissionProvider(Group group, User user) Creates an instance of aPermissionProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.getPermissions(int userId) Retrieves a list of permissions for a user based on their user ID.group()Returns the value of thegrouprecord component.final inthashCode()Returns a hash code value for this object.booleanhasPermission(int userId, String permission) Checks if a user identified by their unique user ID has a specific permission.booleanhasPermission(UUID uuid, String permission) Checks if a user identified by their unique UUID has a specific permission.voidReloads or refreshes any expired entities or permissions within the system.final StringtoString()Returns a string representation of this record class.user()Returns the value of theuserrecord component.
-
Constructor Details
-
PermissionProvider
Creates an instance of aPermissionProviderrecord class.- Parameters:
group- the value for thegrouprecord componentuser- the value for theuserrecord component
-
-
Method Details
-
getPermissions
Description copied from interface:PermissionRetrieves a list of permissions for a user based on their user ID. This includes both the user's direct permissions and those inherited from parent entities.- Specified by:
getPermissionsin interfacePermission- Parameters:
userId- The unique identifier of the user whose permissions are to be retrieved.- Returns:
- A list of all permissions applicable to the specified user.
-
loadExpired
public void loadExpired()Description copied from interface:PermissionReloads or refreshes any expired entities or permissions within the system. This method is intended to invoke expiration-related updates for underlying group and user components.- Specified by:
loadExpiredin interfacePermission
-
hasPermission
Description copied from interface:PermissionChecks if a user identified by their unique UUID has a specific permission.- Specified by:
hasPermissionin interfacePermission- Parameters:
uuid- The universally unique identifier (UUID) of the user.permission- The permission string to check for the user.- Returns:
trueif the user has the specified permission, otherwisefalse.
-
hasPermission
Description copied from interface:PermissionChecks if a user identified by their unique user ID has a specific permission.- Specified by:
hasPermissionin interfacePermission- Parameters:
userId- The unique identifier of the user to check permissions for.permission- The specific permission string to verify for the user.- Returns:
trueif the user has the specified permission, otherwisefalse.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
group
Returns the value of thegrouprecord component.- Returns:
- the value of the
grouprecord component
-
user
Returns the value of theuserrecord component.- Returns:
- the value of the
userrecord component
-