public class SecurityUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ANONYMOUS_USERNAME |
static String |
AUTHORITY_ANONYMOUS |
static String |
AUTHORITY_SU |
static String |
AUTHORITY_USER |
static String |
ROLE_ACL_GENERAL_CHANGES |
static String |
ROLE_ACL_MODIFY_AUDITING |
static String |
ROLE_ACL_TAKE_OWNERSHIP |
static String |
ROLE_SYSTEM |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
currentUserHasRole(String... roles)
Returns whether the current user has at least one of the given roles
|
static boolean |
currentUserIsAnonymous() |
static boolean |
currentUserIsAuthenticated()
Returns whether the current user is authenticated and not the anonymous user
|
static boolean |
currentUserIsSu()
Returns whether the current user is a super user
|
static boolean |
currentUserIsSuOrSystem()
Returns whether the current user is a superuser or the system user.
|
static boolean |
currentUserIsSystem()
Returns whether the current user is the system user.
|
static String |
getCurrentUsername()
Returns the username of the current authentication.
|
public static final String ANONYMOUS_USERNAME
public static final String AUTHORITY_SU
public static final String AUTHORITY_ANONYMOUS
public static final String AUTHORITY_USER
public static final String ROLE_SYSTEM
public static final String ROLE_ACL_TAKE_OWNERSHIP
public static final String ROLE_ACL_MODIFY_AUDITING
public static final String ROLE_ACL_GENERAL_CHANGES
@Nullable public static String getCurrentUsername()
public static boolean currentUserHasRole(String... roles)
public static boolean currentUserIsSuOrSystem()
public static boolean currentUserIsSu()
public static boolean currentUserIsSystem()
public static boolean currentUserIsAuthenticated()
public static boolean currentUserIsAnonymous()
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.