Class UserRolesConfig

java.lang.Object
com.polarion.platform.spi.security.UserRolesConfig

public class UserRolesConfig extends Object
Object encapsulation of the user-roles.xml config file

This class it NOT thread safe!

Author:
dobisekm
  • Field Details

  • Constructor Details

    • UserRolesConfig

      public UserRolesConfig()
    • UserRolesConfig

      public UserRolesConfig(@NotNull Document config)
    • UserRolesConfig

      public UserRolesConfig(@NotNull Document config, @Nullable ILocation loc)
      Since:
      3.7.2
    • UserRolesConfig

      public UserRolesConfig(@Nullable UserRolesConfig parent, @NotNull InputStream in)
      Parses the xml from the stream & closes it.
    • UserRolesConfig

      public UserRolesConfig(@Nullable UserRolesConfig parent, @NotNull InputStream in, @Nullable ILocation loc)
      Parses the xml from the stream & closes it.
      Since:
      3.7.2
  • Method Details

    • isGlobal

      public boolean isGlobal()
      Since:
      3.5.2
    • serialize

      public Document serialize()
    • getUsers

      @NotNull public Set<String> getUsers()
      Returns the users mentioned in this config
      Returns:
      Collection of String
    • getUserRoles

      @NotNull public Set<String> getUserRoles(@NotNull String userName)
    • getUserRoles

      @NotNull public Set<String> getUserRoles(@NotNull String userName, boolean includeParentRoles)
      Returns a set of roles that belong to the specified user in the context defined for this configuration object.
      Parameters:
      userName - user ID.
      includeParentRoles - if true, the resulting set will also contain the roles defined in the parent context (i.e. global roles associated with the user).
      Since:
      3.20.1
    • getUsersWithRole

      @NotNull public Set<String> getUsersWithRole(@NotNull String role)
    • removeUser

      public boolean removeUser(@NotNull String userName)
    • removeRole

      public boolean removeRole(@NotNull String role)
    • addUserRole

      public boolean addUserRole(@NotNull String userName, @NotNull String role)
    • removeUserRole

      public boolean removeUserRole(@NotNull String userName, @NotNull String role)