Package io.stargate.auth
Interface AuthorizationProcessor
-
public interface AuthorizationProcessorAn abstraction of the authorization command processor in Stargate.This interface is intended to broadly cover the functionality of CQL GRANT/REVOKE commands in a programmatic API.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletionStage<Void>addPermissions(Actor performer, AuthorizationOutcome outcome, PermissionKind kind, Collection<AccessPermission> permissions, AuthorizedResource resource, EntitySelector grantee)Grantsgranteethe specified accesspermissionson the specifiedresource.CompletionStage<Void>removePermissions(Actor performer, AuthorizationOutcome outcome, PermissionKind kind, Collection<AccessPermission> permissions, AuthorizedResource resource, EntitySelector grantee)Revokes the specified accesspermissionson the specifiedresourcefrom thegrantee.
-
-
-
Method Detail
-
addPermissions
CompletionStage<Void> addPermissions(Actor performer, AuthorizationOutcome outcome, PermissionKind kind, Collection<AccessPermission> permissions, AuthorizedResource resource, EntitySelector grantee)
Grantsgranteethe specified accesspermissionson the specifiedresource. Note that access can be positive (AuthorizationOutcome.ALLOWor negativeAuthorizationOutcome.DENY. Negative permissions have precedence over positive permissions.- Parameters:
performer- the user under whose authority the grant operation is performedoutcome- whether operations under the specified permissions are allowed or deniedkind- whether permission is granted to access the resource or control access to itpermissions- the list of permissions to be grantedresource- the resource whose access permissions are grantedgrantee- the role receiving the permissions- Returns:
- the
CompletionStagetracking the progress of the grant operation.
-
removePermissions
CompletionStage<Void> removePermissions(Actor performer, AuthorizationOutcome outcome, PermissionKind kind, Collection<AccessPermission> permissions, AuthorizedResource resource, EntitySelector grantee)
Revokes the specified accesspermissionson the specifiedresourcefrom thegrantee. Note that revoking anegativepermission is essentially widening access to the resource.- Parameters:
performer- the user under whose authority the revocation operation is performedoutcome- whether operations under the specified permissions are allowed or deniedkind- whether permission is granted to access the resource or control access to itpermissions- the list of permissions to be revokedresource- the resource whose access permissions are revokedgrantee- the role whose permissions are revoked- Returns:
- the
CompletionStagetracking the progress of the grant operation.
-
-