View Source Rolex.Control (Rolex v0.1.1)

Provides functions for granting, denying, and revoking permissions.

Summary

Functions

Creates a role-denying permission with the given options.

Creates a role-denying permission.

Creates a role-denying permission, prefilling [on: noun].

Creates a role-denying permission, prefilling [on: noun].

Creates a role-denying permission, prefilling [role: noun].

Creates a role-denying permission, prefilling [role: noun].

Creates a role-denying permission, prefilling [to: noun].

Creates a role-denying permission, prefilling [to: noun].

Creates a role-granting permission with the given options.

Creates a role-granting permission.

Creates a role-granting permission, prefilling [on: noun].

Creates a role-granting permission, prefilling [on: noun].

Creates a role-granting permission, prefilling [role: noun].

Creates a role-granting permission, prefilling [role: noun].

Creates a role-granting permission, prefilling [to: noun].

Creates a role-granting permission, prefilling [to: noun].

Adds a multi operation to create a role-denying permission.

Adds a multi operation to create a role-denying permission, prefilling [on: noun].

Adds a multi operation to create a role-denying permission, prefilling [role: noun].

Adds a multi operation to create a role-denying permission, prefilling [to: noun].

Adds a multi operation to create a role-granting permission.

Adds a multi operation to create a role-granting permission, prefilling [on: noun].

Adds a multi operation to create a role-granting permission, prefilling [role: noun].

Adds a multi operation to create a role-granting permission, prefilling [to: noun].

Adds an operation to delete all permissions matching the given options exactly.

Adds a multi operation to delete all permissions matching the given options exactly, prefilling [from: noun].

Adds a multi operation to delete all permissions matching the given options exactly, prefilling [on: noun].

Adds a multi operation to delete all permissions matching the given options exactly, prefilling [role: noun].

Deletes all permissions matching the given options.

Deletes all permissions matching the given options exactly.

Deletes all permissions matching the given options exactly, prefilling [from: noun].

Deletes all permissions matching the given options exactly, prefilling [from: noun].

Deletes all permissions matching the given options exactly, prefilling [on: noun].

Deletes all permissions matching the given options exactly, prefilling [on: noun].

Deletes all permissions matching the given options exactly, prefilling [role: noun].

Deletes all permissions matching the given options exactly, prefilling [role: noun].

Functions

Creates a role-denying permission with the given options.

Returns {:ok, %Permission{}} on success.

See c:Rolex.Options for options.

Creates a role-denying permission.

Returns %Permission{} on success; raises an exception otherwise.

See c:Rolex.Options for options.

Link to this function

deny_on(noun, opts \\ [])

View Source

Creates a role-denying permission, prefilling [on: noun].

Returns {:ok, noun} on success.

See c:Rolex.Options for other options.

Link to this function

deny_on!(noun, opts \\ [])

View Source

Creates a role-denying permission, prefilling [on: noun].

Returns noun on success; raises an exception otherwise.

See c:Rolex.Options for other options.

Link to this function

deny_role(noun, opts \\ [])

View Source

Creates a role-denying permission, prefilling [role: noun].

Returns {:ok, noun} on success.

See c:Rolex.Options for other options.

Link to this function

deny_role!(noun, opts \\ [])

View Source

Creates a role-denying permission, prefilling [role: noun].

Returns noun on success; raises an exception otherwise.

See c:Rolex.Options for other options.

Link to this function

deny_to(noun, opts \\ [])

View Source

Creates a role-denying permission, prefilling [to: noun].

Returns {:ok, noun} on success.

See c:Rolex.Options for other options.

Link to this function

deny_to!(noun, opts \\ [])

View Source

Creates a role-denying permission, prefilling [to: noun].

Returns noun on success; raises an exception otherwise.

See c:Rolex.Options for other options.

Creates a role-granting permission with the given options.

Returns {:ok, %Permission{}} on success.

See c:Rolex.Options for options.

Creates a role-granting permission.

Returns %Permission{} on success; raises an exception otherwise.

See c:Rolex.Options for options.

Link to this function

grant_on(noun, opts \\ [])

View Source

Creates a role-granting permission, prefilling [on: noun].

Returns {:ok, noun} on success.

See c:Rolex.Options for other options.

Link to this function

grant_on!(noun, opts \\ [])

View Source

Creates a role-granting permission, prefilling [on: noun].

Returns noun on success; raises an exception otherwise.

See c:Rolex.Options for other options.

Link to this function

grant_role(noun, opts \\ [])

View Source

Creates a role-granting permission, prefilling [role: noun].

Returns {:ok, noun} on success.

See c:Rolex.Options for other options.

Link to this function

grant_role!(noun, opts \\ [])

View Source

Creates a role-granting permission, prefilling [role: noun].

Returns noun on success; raises an exception otherwise.

See c:Rolex.Options for other options.

Link to this function

grant_to(noun, opts \\ [])

View Source

Creates a role-granting permission, prefilling [to: noun].

Returns {:ok, noun} on success.

See c:Rolex.Options for other options.

Link to this function

grant_to!(noun, opts \\ [])

View Source

Creates a role-granting permission, prefilling [to: noun].

Returns noun on success; raises an exception otherwise.

See c:Rolex.Options for other options.

Link to this function

multi_deny(multi \\ Ecto.Multi.new(), opts \\ [])

View Source

Adds a multi operation to create a role-denying permission.

Returns the updated multi.

See c:Rolex.Options for options.

Link to this function

multi_deny_on(multi \\ Ecto.Multi.new(), noun, opts \\ [])

View Source

Adds a multi operation to create a role-denying permission, prefilling [on: noun].

Returns the updated multi.

See c:Rolex.Options for other options.

Link to this function

multi_deny_role(multi \\ Ecto.Multi.new(), noun, opts \\ [])

View Source

Adds a multi operation to create a role-denying permission, prefilling [role: noun].

Returns the updated multi.

See c:Rolex.Options for other options.

Link to this function

multi_deny_to(multi \\ Ecto.Multi.new(), noun, opts \\ [])

View Source

Adds a multi operation to create a role-denying permission, prefilling [to: noun].

Returns the updated multi.

See c:Rolex.Options for other options.

Link to this function

multi_grant(multi \\ Ecto.Multi.new(), opts \\ [])

View Source

Adds a multi operation to create a role-granting permission.

Returns the updated multi.

See c:Rolex.Options for options.

Link to this function

multi_grant_on(multi \\ Ecto.Multi.new(), noun, opts \\ [])

View Source

Adds a multi operation to create a role-granting permission, prefilling [on: noun].

Returns the updated multi.

See c:Rolex.Options for other options.

Link to this function

multi_grant_role(multi \\ Ecto.Multi.new(), noun, opts \\ [])

View Source

Adds a multi operation to create a role-granting permission, prefilling [role: noun].

Returns the updated multi.

See c:Rolex.Options for other options.

Link to this function

multi_grant_to(multi \\ Ecto.Multi.new(), noun, opts \\ [])

View Source

Adds a multi operation to create a role-granting permission, prefilling [to: noun].

Returns the updated multi.

See c:Rolex.Options for other options.

Link to this function

multi_revoke(multi, opts)

View Source

Adds an operation to delete all permissions matching the given options exactly.

Returns the updated multi.

See c:Rolex.Options for options.

Link to this function

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

View Source

Adds a multi operation to delete all permissions matching the given options exactly, prefilling [from: noun].

Returns the updated multi.

See c:Rolex.Options for other options.

Link to this function

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

View Source

Adds a multi operation to delete all permissions matching the given options exactly, prefilling [on: noun].

Returns the updated multi.

See c:Rolex.Options for other options.

Link to this function

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

View Source

Adds a multi operation to delete all permissions matching the given options exactly, prefilling [role: noun].

Returns the updated multi.

See c:Rolex.Options for other options.

Deletes all permissions matching the given options.

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

See c:Rolex.Options for options.

Deletes all permissions matching the given options exactly.

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

See c:Rolex.Options for options.

Link to this function

revoke_from(noun, opts \\ [])

View Source

Deletes all permissions matching the given options exactly, prefilling [from: noun].

Returns {:ok, noun} on success.

See c:Rolex.Options for other options.

Link to this function

revoke_from!(noun, opts \\ [])

View Source

Deletes all permissions matching the given options exactly, prefilling [from: noun].

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

See c:Rolex.Options for other options.

Link to this function

revoke_on(noun, opts \\ [])

View Source

Deletes all permissions matching the given options exactly, prefilling [on: noun].

Returns {:ok, noun} on success.

See c:Rolex.Options for other options.

Link to this function

revoke_on!(noun, opts \\ [])

View Source

Deletes all permissions matching the given options exactly, prefilling [on: noun].

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

See c:Rolex.Options for other options.

Link to this function

revoke_role(noun, opts \\ [])

View Source

Deletes all permissions matching the given options exactly, prefilling [role: noun].

Returns {:ok, noun} on success.

See c:Rolex.Options for other options.

Link to this function

revoke_role!(noun, opts \\ [])

View Source

Deletes all permissions matching the given options exactly, prefilling [role: noun].

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

See c:Rolex.Options for other options.