public interface Authorizer
1. authorize 2. authorize by matching resource pattern
| Modifier and Type | Method and Description |
|---|---|
boolean |
addGroupsToResource(String resourceType,
String resourceName,
String action,
List<String> groups)
Allow given groups to access the givne resource.
|
void |
addProtectedResource(String resourceType,
String resourceName,
boolean durable,
String owner)
Create auth resource.
|
boolean |
authorize(String scopeName,
String userId)
Authorize user with given scope key.
|
boolean |
authorize(String resourceType,
String resource,
String action,
String userId)
Authorize resource with given resource and action.
|
boolean |
changeResourceOwner(String resourceType,
String resourceName,
String owner)
Create auth resource.
|
void |
deleteProtectedResource(String resourceType,
String resourceName)
Delete auth resource.
|
AuthResource |
getAuthResource(String resourceType,
String resourceName)
Query auth resource.
|
void |
initialize(io.ballerina.messaging.broker.common.StartupContext startupContext)
Initialize authorization strategy based on given auth configuration, user store manager and data source.
|
boolean |
removeGroupFromResource(String resourceType,
String resourceName,
String action,
String group)
Revoke access from the given group.
|
void initialize(io.ballerina.messaging.broker.common.StartupContext startupContext)
throws Exception
startupContext - the startup context provides registered services for authProviderExceptionboolean authorize(String scopeName, String userId) throws AuthException, AuthServerException, AuthNotFoundException
scopeName - a scope keyuserId - an user identifierAuthException - throws if error occur during authorizationAuthServerExceptionAuthNotFoundExceptionboolean authorize(String resourceType, String resource, String action, String userId) throws AuthException, AuthServerException, AuthNotFoundException
resourceType - resource Typeresource - resourceaction - actionuserId - user identifierAuthException - throws if error occur during authorizationAuthServerExceptionAuthNotFoundExceptionvoid addProtectedResource(String resourceType, String resourceName, boolean durable, String owner) throws AuthServerException
resourceType - resource typeresourceName - resource namedurable - is durableowner - resource ownerAuthServerException - throws if error occurs while authorizing resourcevoid deleteProtectedResource(String resourceType, String resourceName) throws AuthServerException, AuthNotFoundException
resourceType - resource typeresourceName - resource nameAuthServerException - throws if error occurs while authorizing resourceAuthNotFoundException - throws if auth resource is not foundboolean addGroupsToResource(String resourceType, String resourceName, String action, List<String> groups) throws AuthServerException
resourceType - resource typeresourceName - resource nameaction - actiongroups - list of group to addAuthServerException - throws if error occurred while adding groups to resourceboolean removeGroupFromResource(String resourceType, String resourceName, String action, String group) throws AuthServerException, AuthNotFoundException
resourceType - resource typeresourceName - resource nameaction - actiongroup - groupAuthServerException - throws if an server error occurredAuthNotFoundException - throws if the resource is not foundboolean changeResourceOwner(String resourceType, String resourceName, String owner) throws AuthServerException, AuthNotFoundException, AuthException
resourceType - resource typeresourceName - resource nameowner - newOwnerAuthServerException - throws if an server error occurredAuthNotFoundException - throws if the resource is not foundAuthExceptionAuthResource getAuthResource(String resourceType, String resourceName) throws AuthServerException, AuthNotFoundException
resourceType - resource typeresourceName - resource nameAuthServerException - throws if error occurs while authorizing resourceAuthNotFoundException - throws if auth resource is not foundCopyright © 2018 WSO2. All rights reserved.