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
fun allowAll(condition: RuleCondition<Principal, Resource>)

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
fun denyAll(condition: RuleCondition<Principal, Resource>)

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

Link copied to clipboard
fun derivedRole(role: String, condition: DerivedRoleCondition<Principal, Resource>)

Creates a derived role definition based on the condition provided.