Interface RoleMapper

All Known Implementing Classes:
RoleMapperFactory.NullRoleMapper

public interface RoleMapper
Map Nxt account to authentication role
  • Method Summary

    Modifier and Type
    Method
    Description
    getUserRoles(String rsAccount)
    Get the user roles for the supplied Nxt account
    boolean
    isUserInRole(long accountId, Role role)
    Check if the supplied Nxt account has the specified user role
    boolean
    isValidRoleSetter(long setterId)
    Check if the supplied Nxt account is allowed to set user roles.
    Parse the account property string containing the user roles.
  • Method Details

    • getUserRoles

      EnumSet<Role> getUserRoles(String rsAccount)
      Get the user roles for the supplied Nxt account
      Parameters:
      rsAccount - Nxt account
      Returns:
      Set of user roles
    • parseRoles

      EnumSet<Role> parseRoles(String value)
      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

      boolean isUserInRole(long accountId, Role role)
      Check if the supplied Nxt account has the specified user role
      Parameters:
      accountId - Account identifier
      role - User role
      Returns:
      TRUE if the account has the specified user role