View Source Rolex.Check (Rolex v0.5.1)

Functions for checking permissions.

Summary

Functions

Returns true if given any granted permissions that meet DSL options.

Returns true if given any granted permissions that meet DSL options, prefilling on: object.

Returns true if given any granted permissions that meet DSL options, prefilling role: role.

Returns true if given any granted permissions that meet DSL options, prefilling to: subject.

Lists roles granted by given permissions that meet DSL options.

Lists roles granted by the given permissions that meet DSL options, prefilling on: object.

Lists roles granted by the given permissions that meet DSL options, prefilling to: subject.

Types

Functions

Link to this function

granted?(permissions, opts \\ [])

View Source
@spec granted?([Rolex.Permission.t()], [any_role_opt() | any_to_opt() | any_on_opt()]) ::
  boolean()

Returns true if given any granted permissions that meet DSL options.

Link to this function

granted_on?(permissions, object, opts \\ [])

View Source
@spec granted_on?([Rolex.Permission.t()], any_scope(), [any_role_opt() | any_to_opt()]) ::
  boolean()

Returns true if given any granted permissions that meet DSL options, prefilling on: object.

Link to this function

granted_role?(permissions, role, opts \\ [])

View Source
@spec granted_role?([Rolex.Permission.t()], any_role(), [any_to_opt() | any_on_opt()]) ::
  boolean()

Returns true if given any granted permissions that meet DSL options, prefilling role: role.

Link to this function

granted_to?(permissions, subject, opts \\ [])

View Source
@spec granted_to?([Rolex.Permission.t()], any_scope(), [any_role_opt() | any_on_opt()]) ::
  boolean()

Returns true if given any granted permissions that meet DSL options, prefilling to: subject.

Link to this function

roles_granted(permissions, opts \\ [])

View Source
@spec roles_granted([Rolex.Permission.t()], [
  any_role_opt() | any_to_opt() | any_on_opt()
]) :: [role()]

Lists roles granted by given permissions that meet DSL options.

Link to this function

roles_granted_on(permissions, object, opts \\ [])

View Source
@spec roles_granted_on([Rolex.Permission.t()], any_scope(), [
  any_role_opt() | any_to_opt()
]) :: [role()]

Lists roles granted by the given permissions that meet DSL options, prefilling on: object.

Link to this function

roles_granted_to(permissions, subject, opts \\ [])

View Source
@spec roles_granted_to([Rolex.Permission.t()], any_scope(), [
  any_role_opt() | any_on_opt()
]) :: [role()]

Lists roles granted by the given permissions that meet DSL options, prefilling to: subject.