public class DefaultSecurityService extends Object implements SecurityService
| Constructor and Description |
|---|
DefaultSecurityService(PermissionRepository permissionRepository,
ScopeRepository scopeRepository) |
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
checkScopes(Set<String> requestedScopes)
Returns the sub-set of requested scopes that the user is permitted to access.
|
Set<String> |
extractPermissions(Set<String> scopes)
Returns the set of permissions the user has for the given scopes.
|
void |
setSecurityContextAccessor(org.springframework.security.oauth2.provider.SecurityContextAccessor securityContextAccessor) |
public DefaultSecurityService(PermissionRepository permissionRepository, ScopeRepository scopeRepository)
public Set<String> checkScopes(Set<String> requestedScopes)
SecurityServiceSecurityServiceOAuth2RequestFactory to check that the
requested scopes are accessible for the current user. If none of the requested scopes are
accessible, this will return an empty set.checkScopes in interface SecurityServicerequestedScopes - the set of requested scopespublic Set<String> extractPermissions(Set<String> scopes)
SecurityServiceSecurityServiceAccessTokenConverter to extract the set
of permissions the user has for the requested scopes.extractPermissions in interface SecurityServicescopes - the scopespublic void setSecurityContextAccessor(org.springframework.security.oauth2.provider.SecurityContextAccessor securityContextAccessor)
Copyright © 2021. All rights reserved.