public class SecurityUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ANONYMOUS_USERNAME |
static String |
AUTHORITY_ANONYMOUS |
static String |
AUTHORITY_ENTITY_PREFIX |
static String |
AUTHORITY_ENTITY_READ_PREFIX |
static String |
AUTHORITY_ENTITY_WRITE_PREFIX |
static String |
AUTHORITY_PLUGIN_PREFIX |
static String |
AUTHORITY_PLUGIN_READ_PREFIX |
static String |
AUTHORITY_PLUGIN_WRITE_PREFIX |
static String |
AUTHORITY_SU |
| Constructor and Description |
|---|
SecurityUtils() |
| 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 |
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 String[] |
defaultPluginAuthorities(String... pluginIds)
Returns the default (su, read, write) roles related to a plugin
|
static String |
getCurrentUsername() |
static String |
getPluginReadAuthority(String pluginId) |
static String |
getPluginWriteAuthority(String pluginId) |
public static final String ANONYMOUS_USERNAME
public static final String AUTHORITY_SU
public static final String AUTHORITY_ANONYMOUS
public static final String AUTHORITY_PLUGIN_PREFIX
public static final String AUTHORITY_PLUGIN_READ_PREFIX
public static final String AUTHORITY_PLUGIN_WRITE_PREFIX
public static final String AUTHORITY_ENTITY_PREFIX
public static final String AUTHORITY_ENTITY_READ_PREFIX
public static final String AUTHORITY_ENTITY_WRITE_PREFIX
public static String getCurrentUsername()
public static boolean currentUserHasRole(String... roles)
roles - public static boolean currentUserIsSu()
public static boolean currentUserIsAuthenticated()
public static String[] defaultPluginAuthorities(String... pluginIds)
pluginId - Copyright © 2015. All Rights Reserved.