View Source Rolex.Control (Rolex v0.4.1)

Provides functions for granting, denying, and revoking permissions.

Summary

Functions

Creates a role-denying permission from DSL options.

Creates a role-denying permission from DSL options.

Creates a role-denying permission from DSL options, prefilling on: object.

Creates a role-denying permission from DSL options, prefilling on: object.

Creates a role-denying permission from DSL options, prefilling role: role.

Creates a role-denying permission from DSL options, prefilling role: role.

Creates a role-denying permission from DSL options, prefilling to: subject.

Creates a role-denying permission from DSL options, prefilling to: subject.

Creates a role-granting permission from DSL options.

Creates a role-granting permission from DSL options.

Creates a role-granting permission from DSL options, prefilling on: object.

Creates a role-granting permission from DSL options, prefilling on: object.

Creates a role-granting permission from DSL options, prefilling role: role.

Creates a role-granting permission from DSL options, prefilling role: role.

Creates a role-granting permission from DSL options, prefilling to: subject.

Creates a role-granting permission from DSL options, prefilling to: subject.

Adds a multi operation to create a role-denying permission from DSL options.

Adds a multi operation to create a role-denying permission from DSL options, prefilling on: object.

Adds a multi operation to create a role-denying permission from DSL options, prefilling role: role.

Adds a multi operation to create a role-denying permission from DSL options, prefilling to: subject.

Adds a multi operation to create a role-granting permission from DSL options.

Adds a multi operation to create a role-granting permission from DSL options, prefilling on: object.

Adds a multi operation to create a role-granting permission from DSL options, prefilling role: role.

Adds a multi operation to create a role-granting permission from DSL options, prefilling to: subject.

Adds a multi operation to delete all permissions matching the given DSL options.

Adds a multi operation to delete all permissions matching the given DSL options, prefilling from: subject.

Adds a multi operation to delete all permissions matching the given DSL options, prefilling on: object.

Adds a multi operation to delete all permissions matching the given DSL options, prefilling role: role.

Deletes all permissions matching the given DSL options.

Deletes all permissions matching the given DSL options.

Deletes all permissions matching the given DSL options, prefilling from: subject.

Deletes all permissions matching the given DSL options, prefilling from: subject.

Deletes all permissions matching the given DSL options, prefilling on: object.

Deletes all permissions matching the given DSL options, prefilling on: object.

Deletes all permissions matching the given DSL options, prefilling role: role.

Deletes all permissions matching the given DSL options, prefilling role: role.

Types

Functions

@spec deny([role_opt() | to_opt() | on_opt()]) :: :ok | {:error, term()}

Creates a role-denying permission from DSL options.

Returns :ok on success, or {:error, reason} otherwise.

@spec deny!([role_opt() | to_opt() | on_opt()]) :: :ok

Creates a role-denying permission from DSL options.

Returns :ok on success, or raises an exception otherwise.

Link to this function

deny_on(object, opts \\ [])

View Source
@spec deny_on(scope(), [role_opt() | to_opt()]) :: {:ok, scope()} | {:error, term()}

Creates a role-denying permission from DSL options, prefilling on: object.

Returns {:ok, object} on success, or {:error, reason} otherwise.

Link to this function

deny_on!(object, opts \\ [])

View Source
@spec deny_on!(scope(), [role_opt() | to_opt()]) :: scope()

Creates a role-denying permission from DSL options, prefilling on: object.

Returns object on success, or raises an exception otherwise.

Link to this function

deny_role(role, opts \\ [])

View Source
@spec deny_role(role(), [to_opt() | on_opt()]) :: {:ok, role()} | {:error, term()}

Creates a role-denying permission from DSL options, prefilling role: role.

Returns {:ok, role} on success, or {:error, reason} otherwise.

Link to this function

deny_role!(role, opts \\ [])

View Source
@spec deny_role!(role(), [to_opt() | on_opt()]) :: role()

Creates a role-denying permission from DSL options, prefilling role: role.

Returns role on success, or raises an exception otherwise.

Link to this function

deny_to(subject, opts \\ [])

View Source
@spec deny_to(scope(), [role_opt() | on_opt()]) :: {:ok, scope()} | {:error, term()}

Creates a role-denying permission from DSL options, prefilling to: subject.

Returns {:ok, subject} on success, or {:error, reason} otherwise.

Link to this function

deny_to!(subject, opts \\ [])

View Source
@spec deny_to!(scope(), [role_opt() | on_opt()]) :: scope()

Creates a role-denying permission from DSL options, prefilling to: subject.

Returns subject on success, or raises an exception otherwise.

@spec grant([role_opt() | to_opt() | on_opt()]) :: :ok | {:error, term()}

Creates a role-granting permission from DSL options.

Returns :ok on success, or {:error, reason} otherwise.

@spec grant!([role_opt() | to_opt() | on_opt()]) :: :ok

Creates a role-granting permission from DSL options.

Returns :ok on success, or raises an exception otherwise.

Link to this function

grant_on(object, opts \\ [])

View Source
@spec grant_on(scope(), [role_opt() | to_opt()]) :: {:ok, scope()} | {:error, term()}

Creates a role-granting permission from DSL options, prefilling on: object.

Returns {:ok, object} on success, or {:error, reason} otherwise.

Link to this function

grant_on!(object, opts \\ [])

View Source
@spec grant_on!(scope(), [role_opt() | to_opt()]) :: scope()

Creates a role-granting permission from DSL options, prefilling on: object.

Returns object on success, or raises an exception otherwise.

Link to this function

grant_role(role, opts \\ [])

View Source
@spec grant_role(role(), [to_opt() | on_opt()]) :: {:ok, role()} | {:error, term()}

Creates a role-granting permission from DSL options, prefilling role: role.

Returns {:ok, role} on success, or {:error, reason} otherwise.

Link to this function

grant_role!(role, opts \\ [])

View Source
@spec grant_role!(role(), [to_opt() | on_opt()]) :: role()

Creates a role-granting permission from DSL options, prefilling role: role.

Returns role on success, or raises an exception otherwise.

Link to this function

grant_to(subject, opts \\ [])

View Source
@spec grant_to(scope(), [role_opt() | on_opt()]) :: {:ok, scope()} | {:error, term()}

Creates a role-granting permission from DSL options, prefilling to: subject.

Returns {:ok, subject} on success, or {:error, reason} otherwise.

Link to this function

grant_to!(subject, opts \\ [])

View Source
@spec grant_to!(scope(), [role_opt() | on_opt()]) :: scope()

Creates a role-granting permission from DSL options, prefilling to: subject.

Returns subject on success, or raises an exception otherwise.

Link to this function

multi_deny(multi, opts \\ [])

View Source
@spec multi_deny(multi(), [role_opt() | to_opt() | on_opt()]) :: multi()

Adds a multi operation to create a role-denying permission from DSL options.

Returns the updated multi.

Link to this function

multi_deny_on(multi, object, opts \\ [])

View Source
@spec multi_deny_on(multi(), scope(), [role_opt() | to_opt()]) :: multi()

Adds a multi operation to create a role-denying permission from DSL options, prefilling on: object.

Returns the updated multi.

Link to this function

multi_deny_role(multi, role, opts \\ [])

View Source
@spec multi_deny_role(multi(), role(), [to_opt() | on_opt()]) :: multi()

Adds a multi operation to create a role-denying permission from DSL options, prefilling role: role.

Returns the updated multi.

Link to this function

multi_deny_to(multi, subject, opts \\ [])

View Source
@spec multi_deny_to(multi(), scope(), [role_opt() | on_opt()]) :: multi()

Adds a multi operation to create a role-denying permission from DSL options, prefilling to: subject.

Returns the updated multi.

Link to this function

multi_grant(multi, opts \\ [])

View Source
@spec multi_grant(multi(), [role_opt() | to_opt() | on_opt()]) :: multi()

Adds a multi operation to create a role-granting permission from DSL options.

Returns the updated multi.

Link to this function

multi_grant_on(multi, object, opts \\ [])

View Source
@spec multi_grant_on(multi(), scope(), [role_opt() | to_opt()]) :: multi()

Adds a multi operation to create a role-granting permission from DSL options, prefilling on: object.

Returns the updated multi.

Link to this function

multi_grant_role(multi, role, opts \\ [])

View Source
@spec multi_grant_role(multi(), role(), [to_opt() | on_opt()]) :: multi()

Adds a multi operation to create a role-granting permission from DSL options, prefilling role: role.

Returns the updated multi.

Link to this function

multi_grant_to(multi, subject, opts \\ [])

View Source
@spec multi_grant_to(multi(), scope(), [role_opt() | on_opt()]) :: multi()

Adds a multi operation to create a role-granting permission from DSL options, prefilling to: subject.

Returns the updated multi.

Link to this function

multi_revoke(multi, opts \\ [])

View Source
@spec multi_revoke(multi(), [any_role_opt() | any_from_opt() | any_on_opt()]) ::
  multi()

Adds a multi operation to delete all permissions matching the given DSL options.

Returns the updated multi.

Link to this function

multi_revoke_from(multi, subject, opts \\ [])

View Source
@spec multi_revoke_from(multi(), any_scope(), [any_role_opt() | any_on_opt()]) ::
  multi()

Adds a multi operation to delete all permissions matching the given DSL options, prefilling from: subject.

Returns the updated multi.

Link to this function

multi_revoke_on(multi, object, opts \\ [])

View Source
@spec multi_revoke_on(multi(), any_scope(), [any_role_opt() | any_from_opt()]) ::
  multi()

Adds a multi operation to delete all permissions matching the given DSL options, prefilling on: object.

Returns the updated multi.

Link to this function

multi_revoke_role(multi, role, opts \\ [])

View Source
@spec multi_revoke_role(multi(), any_role(), [any_from_opt() | any_on_opt()]) ::
  multi()

Adds a multi operation to delete all permissions matching the given DSL options, prefilling role: role.

Returns the updated multi.

@spec revoke([any_role_opt() | any_from_opt() | any_on_opt()]) ::
  {:ok, non_neg_integer()} | {:error, term()}

Deletes all permissions matching the given DSL options.

Returns {:ok, <number-deleted>} on success, or {:error, changeset} otherwise.

@spec revoke!([any_role_opt() | any_from_opt() | any_on_opt()]) :: non_neg_integer()

Deletes all permissions matching the given DSL options.

Returns the number of permissions deleted on success, or raises an exception otherwise.

Link to this function

revoke_from(subject, opts \\ [])

View Source
@spec revoke_from(any_scope(), [role_opt() | any_on_opt()]) ::
  {:ok, any_scope()} | {:error, term()}

Deletes all permissions matching the given DSL options, prefilling from: subject.

Returns {:ok, subject} on success, or {:error, reason} otherwise.

Link to this function

revoke_from!(subject, opts \\ [])

View Source
@spec revoke_from!(any_scope(), [role_opt() | any_on_opt()]) :: any_scope()

Deletes all permissions matching the given DSL options, prefilling from: subject.

Returns subject on success, or raises an exception otherwise.

Link to this function

revoke_on(object, opts \\ [])

View Source
@spec revoke_on(any_scope(), [role_opt() | any_from_opt()]) ::
  {:ok, any_scope()} | {:error, term()}

Deletes all permissions matching the given DSL options, prefilling on: object.

Returns {:ok, object} on success, or {:error, reason} otherwise.

Link to this function

revoke_on!(object, opts \\ [])

View Source
@spec revoke_on!(any_scope(), [role_opt() | any_from_opt()]) :: any_scope()

Deletes all permissions matching the given DSL options, prefilling on: object.

Returns object on success, or raises an exception otherwise.

Link to this function

revoke_role(role, opts \\ [])

View Source
@spec revoke_role(any_role(), [any_from_opt() | any_on_opt()]) ::
  {:ok, any_role()} | {:error, term()}

Deletes all permissions matching the given DSL options, prefilling role: role.

Returns {:ok, role} on success, or {:error, reason} otherwise.

Link to this function

revoke_role!(role, opts \\ [])

View Source
@spec revoke_role!(any_role(), [any_from_opt() | any_on_opt()]) :: any_role()

Deletes all permissions matching the given DSL options, prefilling role: role.

Returns role on success, or raises an exception otherwise.