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)
SecurityService
SecurityServiceOAuth2RequestFactory
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 SecurityService
requestedScopes
- the set of requested scopespublic Set<String> extractPermissions(Set<String> scopes)
SecurityService
SecurityServiceAccessTokenConverter
to extract the set
of permissions the user has for the requested scopes.extractPermissions
in interface SecurityService
scopes
- the scopespublic void setSecurityContextAccessor(org.springframework.security.oauth2.provider.SecurityContextAccessor securityContextAccessor)
Copyright © 2021. All rights reserved.