ResourcePolicy

Represents a policy defining the rules for accessing a specific type of resource.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun allow(vararg actions: ResourceAction<Resource>, condition: RuleCondition<Principal, Resource>)

Adds a rule to allow the specified actions if the condition is met.

Link copied to clipboard

Adds a rule to allow all actions if the condition is met.

Link copied to clipboard
fun allowed(principal: Principal, resource: Resource, vararg actions: ResourceAction<Resource>): Boolean

Returns a boolean indicating whether the principal is allowed to perform all the specified actions against the resource.

Link copied to clipboard
fun alwaysAllow(vararg actions: ResourceAction<Resource>)

Adds a rule to always allow the specified actions, immaterial of the principal accessing the resource.

Link copied to clipboard
fun deny(vararg actions: ResourceAction<Resource>, condition: RuleCondition<Principal, Resource>)

Adds a rule to deny the specified actions if the condition is met.

Link copied to clipboard

Adds a rule to deny all actions if the condition is met.

Link copied to clipboard

Creates a derived role definition based on the condition provided.

Link copied to clipboard
fun <Filter : Any> filterFor(principal: Principal, action: ResourceAction<Resource>): Filter

Returns the filter declared via listFilter for the given principal and action.

Link copied to clipboard

Declares the filter representing the set of Resource instances the principal is allowed to list under the given action. The producer returns the filter, or null to deny.