public class SecurityUtils extends Object
public static void setSecurityScopeProvider(SecurityScopeProvider securityScopeProvider)
public static GrantedAuthority createTenantAuthority(String tenantId)
public static GrantedAuthority createGroupAuthority(String groupKey)
public static GrantedAuthority createUserDefinitionAuthority(String userDefinitionKey)
public static String extractUserDefinitionKeyFromAuthorities(Collection<? extends GrantedAuthority> authorities)
public static String extractTenantIdFromAuthorities(Collection<? extends GrantedAuthority> authorities)
@Deprecated public static String getCurrentUserId()
SecurityScope.getUserId()
obtained via getCurrentUserSecurityScope()
instead@Deprecated public static String getCurrentTenantId()
SecurityScope.getTenantId()
obtained via getCurrentUserSecurityScope()
insteadpublic static boolean currentUserHasAdminRights(PlatformSecurityInterceptor platformSecurityInterceptor, String[] additionalAdminUsers)
public static boolean currentUserIsTenantAdmin(PlatformSecurityInterceptor platformSecurityInterceptor, String[] additionalAdminUsers, String tenantId)
public static boolean currentUserIsSuperAdmin(PlatformSecurityInterceptor platformSecurityInterceptor, String[] additionalAdminUsers)
@Deprecated public static Set<String> getCurrentUserGroupKeys()
SecurityScope.getGroupKeys()
obtained via getCurrentUserSecurityScope()
instead@Deprecated public static boolean currentUserHasGroup(String group)
SecurityScope.getGroupKeys()
obtained via getCurrentUserSecurityScope()
to check instead@Deprecated public static boolean currentUserHasAuthority(String authority)
SecurityScope.hasAuthority(String)
obtained via getCurrentUserSecurityScope()
insteadpublic static SecurityScope getCurrentUserSecurityScope()
public static SecurityScope getCurrentUserSecurityScopeSafe()
public static SecurityScope getSecurityScope(Authentication authentication)