Class Role

java.lang.Object
org.apache.wiki.auth.authorize.Role
All Implemented Interfaces:
Serializable, Principal

public final class Role extends Object implements Principal, Serializable
A lightweight, immutable Principal that represents a built-in wiki role such as Anonymous, Asserted and Authenticated. It can also represent dynamic roles used by an external Authorizer, such as a web container.
Since:
2.3
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Role
    All users, regardless of authentication status
    static final Role
    If the user hasn't supplied a name
    static final Role
    If the user has supplied a cookie with a username
    static final Role
    If the user has authenticated with the Container or UserDatabase
  • Constructor Summary

    Constructors
    Constructor
    Description
    Role(String name)
    Constructs a new Role with a given name.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Two Role objects are considered equal if their names are identical.
    Returns the name of the Principal.
    int
    Returns a unique hashcode for the Role.
    static boolean
    Returns true if a supplied Role is a built-in Role: ALL, ANONYMOUS, ASSERTED, or AUTHENTICATED.
    static boolean
    Returns true if the supplied name is identical to the name of a built-in Role; that is, the value returned by getName() for built-in Roles ALL, ANONYMOUS, ASSERTED, or AUTHENTICATED.
    Returns a String representation of the role

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.security.Principal

    implies
  • Field Details

    • ALL

      public static final Role ALL
      All users, regardless of authentication status
    • ANONYMOUS

      public static final Role ANONYMOUS
      If the user hasn't supplied a name
    • ASSERTED

      public static final Role ASSERTED
      If the user has supplied a cookie with a username
    • AUTHENTICATED

      public static final Role AUTHENTICATED
      If the user has authenticated with the Container or UserDatabase
  • Constructor Details

    • Role

      public Role(String name)
      Constructs a new Role with a given name.
      Parameters:
      name - the name of the Role
  • Method Details