public class SecurityContextUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
LOG
The Constant LOG.
|
| Constructor and Description |
|---|
SecurityContextUtil() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
anyoneHasPermission(Object targetDomainObject,
Object permission)
Check if ROLE_EVERYONE has permission on target object.
|
static <T extends AclSid> |
getCurrentUser()
Gets the current principal (User or OAuthClient).
|
static <T extends BasicUser<?>> |
getMe()
Gets the me.
|
static String |
getOAuthClientId()
Gets the OAuth Client ID of the current authentication object.
|
static String |
getUsername()
Gets the username.
|
static boolean |
hasPermission(Object targetDomainObject,
Object permission)
Checks for permission.
|
static boolean |
hasRole(String role)
Checks for role.
|
public static String getUsername()
public static <T extends BasicUser<?>> T getMe()
T - the generic typepublic static <T extends AclSid> T getCurrentUser()
T - the generic typepublic static boolean hasRole(String role)
role - the rolepublic static boolean hasPermission(Object targetDomainObject, Object permission)
targetDomainObject - the target domain objectpermission - the permissionpublic static boolean anyoneHasPermission(Object targetDomainObject, Object permission)
targetDomainObject - the target domain objectpermission - the permissionpublic static String getOAuthClientId()
Copyright © 2021 Global Crop Diversity Trust. All rights reserved.