nxt.authentication

## Interface RoleMapper

- All Known Implementing Classes:
    RoleMapperFactory.NullRoleMapper

      public interface RoleMapper

  Map Nxt account to authentication role

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.EnumSet<Role>` | `getUserRoles(java.lang.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.
    `java.util.EnumSet<Role>` | `parseRoles(java.lang.String value)` Parse the account property string containing the user roles.

- - ### Method Detail

    - #### getUserRoles

          java.util.EnumSet<Role> getUserRoles(java.lang.String rsAccount)

      Get the user roles for the supplied Nxt account
      Parameters:
        `rsAccount` - Nxt account
      Returns:
        Set of user roles

    - #### parseRoles

          java.util.EnumSet<Role> parseRoles(java.lang.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