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
@type any_from_opt() :: Rolex.DSL.any_from_opt()
@type any_on_opt() :: Rolex.DSL.any_on_opt()
@type any_role() :: Rolex.DSL.any_role()
@type any_role_opt() :: Rolex.DSL.any_role_opt()
@type any_scope() :: Rolex.DSL.any_scope()
@type any_to_opt() :: Rolex.DSL.any_to_opt()
@type from_opt() :: Rolex.DSL.from_opt()
@type multi() :: Ecto.Multi.t()
@type on_opt() :: Rolex.DSL.on_opt()
@type role() :: Rolex.DSL.role()
@type role_opt() :: Rolex.DSL.role_opt()
@type scope() :: Rolex.DSL.scope()
@type to_opt() :: Rolex.DSL.to_opt()
Functions
Creates a role-denying permission from DSL options.
Returns :ok
on success, or {:error, reason}
otherwise.
Creates a role-denying permission from DSL options.
Returns :ok
on success, or raises an exception otherwise.
Creates a role-denying permission from DSL options, prefilling on: object
.
Returns {:ok, object}
on success, or {:error, reason}
otherwise.
Creates a role-denying permission from DSL options, prefilling on: object
.
Returns object
on success, or raises an exception otherwise.
Creates a role-denying permission from DSL options, prefilling role: role
.
Returns {:ok, role}
on success, or {:error, reason}
otherwise.
Creates a role-denying permission from DSL options, prefilling role: role
.
Returns role
on success, or raises an exception otherwise.
Creates a role-denying permission from DSL options, prefilling to: subject
.
Returns {:ok, subject}
on success, or {:error, reason}
otherwise.
Creates a role-denying permission from DSL options, prefilling to: subject
.
Returns subject
on success, or raises an exception otherwise.
Creates a role-granting permission from DSL options.
Returns :ok
on success, or {:error, reason}
otherwise.
Creates a role-granting permission from DSL options.
Returns :ok
on success, or raises an exception otherwise.
Creates a role-granting permission from DSL options, prefilling on: object
.
Returns {:ok, object}
on success, or {:error, reason}
otherwise.
Creates a role-granting permission from DSL options, prefilling on: object
.
Returns object
on success, or raises an exception otherwise.
Creates a role-granting permission from DSL options, prefilling role: role
.
Returns {:ok, role}
on success, or {:error, reason}
otherwise.
Creates a role-granting permission from DSL options, prefilling role: role
.
Returns role
on success, or raises an exception otherwise.
Creates a role-granting permission from DSL options, prefilling to: subject
.
Returns {:ok, subject}
on success, or {:error, reason}
otherwise.
Creates a role-granting permission from DSL options, prefilling to: subject
.
Returns subject
on success, or raises an exception otherwise.
Adds a multi operation to create a role-denying permission from DSL options.
Returns the updated multi.
Adds a multi operation to create a role-denying permission from DSL options, prefilling on: object
.
Returns the updated multi.
Adds a multi operation to create a role-denying permission from DSL options, prefilling role: role
.
Returns the updated multi.
Adds a multi operation to create a role-denying permission from DSL options, prefilling to: subject
.
Returns the updated multi.
Adds a multi operation to create a role-granting permission from DSL options.
Returns the updated multi.
Adds a multi operation to create a role-granting permission from DSL options, prefilling on: object
.
Returns the updated multi.
Adds a multi operation to create a role-granting permission from DSL options, prefilling role: role
.
Returns the updated multi.
Adds a multi operation to create a role-granting permission from DSL options, prefilling to: subject
.
Returns the updated multi.
@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.
@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.
@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.
@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.
@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.
@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.
@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.
@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.
@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.
@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.