nxt.authentication

## Class RoleMapperFactory.NullRoleMapper

- java.lang.Object
- - nxt.authentication.RoleMapperFactory.NullRoleMapper

- All Implemented Interfaces:
    RoleMapper
  Enclosing class:
    RoleMapperFactory

      public static class RoleMapperFactory.NullRoleMapper
      extends java.lang.Object
      implements RoleMapper

  Dummy role mapper for a non-permissioned blockchain

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NullRoleMapper()`

  - ### Method Summary

    All Methods Instance Methods Concrete 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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NullRoleMapper

          public NullRoleMapper()

  - ### Method Detail

    - #### getUserRoles

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

      Description copied from interface: `RoleMapper`
      Get the user roles for the supplied Nxt account
      Specified by:
        `getUserRoles` in interface `RoleMapper`
      Parameters:
        `rsAccount` - Nxt account
      Returns:
        Set of user roles

    - #### isValidRoleSetter

          public boolean isValidRoleSetter(long setterId)

      Description copied from interface: `RoleMapper`
      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.
      Specified by:
        `isValidRoleSetter` in interface `RoleMapper`
      Parameters:
        `setterId` - Account setting the user roles
      Returns:
        TRUE if the account is allowed to set user roles

    - #### isUserInRole

          public boolean isUserInRole(long accountId,
                                      Role role)

      Description copied from interface: `RoleMapper`
      Check if the supplied Nxt account has the specified user role
      Specified by:
        `isUserInRole` in interface `RoleMapper`
      Parameters:
        `accountId` - Account identifier
        `role` - User role
      Returns:
        TRUE if the account has the specified user role

    - #### parseRoles

          public java.util.EnumSet<Role> parseRoles(java.lang.String value)

      Description copied from interface: `RoleMapper`
      Parse the account property string containing the user roles. Multiple roles can be specified separated by commas.
      Specified by:
        `parseRoles` in interface `RoleMapper`
      Parameters:
        `value` - User roles
      Returns:
        Set of user roles