public class CloudFoundrySecurityService extends Object
Constructor and Description |
---|
CloudFoundrySecurityService(org.springframework.security.oauth2.client.OAuth2RestTemplate oAuth2RestTemplate,
String cloudControllerUrl,
String applicationId) |
Modifier and Type | Method and Description |
---|---|
AccessLevel |
getAccessLevel(String token,
String applicationId)
Return the access level that should be granted to the given token.
|
boolean |
isSpaceDeveloper()
Returns
true if the user (using the access-token from
OAuth2RestTemplate ) has full AccessLevel.FULL for the provided
applicationId |
public boolean isSpaceDeveloper()
true
if the user (using the access-token from
OAuth2RestTemplate
) has full AccessLevel.FULL
for the provided
applicationId
public AccessLevel getAccessLevel(String token, String applicationId) throws CloudFoundryAuthorizationException
token
- the tokenapplicationId
- the cloud foundry application IDCloudFoundryAuthorizationException
- if the token is not authorizedCopyright © 2018 Pivotal Software, Inc.. All rights reserved.