Package nxt.authentication
Interface RoleMapper
- All Known Implementing Classes:
RoleMapperFactory.NullRoleMapper
public interface RoleMapper
Map Nxt account to authentication role
-
Method Summary
Modifier and TypeMethodDescriptiongetUserRoles(String rsAccount) Get the user roles for the supplied Nxt accountbooleanisUserInRole(long accountId, Role role) Check if the supplied Nxt account has the specified user rolebooleanisValidRoleSetter(long setterId) Check if the supplied Nxt account is allowed to set user roles.parseRoles(String value) Parse the account property string containing the user roles.
-
Method Details
-
getUserRoles
Get the user roles for the supplied Nxt account- Parameters:
rsAccount- Nxt account- Returns:
- Set of user roles
-
parseRoles
Parse the account property string containing the user roles. Multiple roles can be specified separated by commas.- Parameters:
value- User roles- Returns:
- Set of user roles
-
isValidRoleSetter
boolean isValidRoleSetter(long setterId) Check if the supplied Nxt account is allowed to set user roles. An account must have the ADMIN role in order to set user roles.- Parameters:
setterId- Account setting the user roles- Returns:
- TRUE if the account is allowed to set user roles
-
isUserInRole
Check if the supplied Nxt account has the specified user role- Parameters:
accountId- Account identifierrole- User role- Returns:
- TRUE if the account has the specified user role
-