Package org.gbif.api.model.common
Class GbifUserPrincipal
java.lang.Object
org.gbif.api.model.common.GbifUserPrincipal
- All Implemented Interfaces:
Principal
,ExtendedPrincipal
A wrapper class for a GBIF User that exposes the unique account name as the principal name.
Replacement for
UserPrincipal
-
Constructor Details
-
GbifUserPrincipal
-
-
Method Details
-
getName
-
getUser
-
hasRole
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 interfaceExtendedPrincipal
- Parameters:
role
- case insensitive role- Returns:
- true if the user has the requested role
-