Class GbifUserPrincipal

java.lang.Object
org.gbif.api.model.common.GbifUserPrincipal
All Implemented Interfaces:
Principal, ExtendedPrincipal

public class GbifUserPrincipal extends Object implements ExtendedPrincipal
A wrapper class for a GBIF User that exposes the unique account name as the principal name. Replacement for UserPrincipal
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface Principal
    • getUser

      public GbifUser getUser()
    • hasRole

      public boolean hasRole(String role)
      Checks if the user has the given string based role. We use strings here and not the enum to facilitate the use of the method with the standard SecurityContext which uses Strings for roles.
      Specified by:
      hasRole in interface ExtendedPrincipal
      Parameters:
      role - case insensitive role
      Returns:
      true if the user has the requested role