View Source Rolex.Check (Rolex v0.4.1)

Functions for checking permissions.

Summary

Functions

Returns true if any of the given permissions meeting the conditions in opts are granted.

Returns true if any of the given permissions meeting the conditions in opts are granted.

Types

@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()

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 any of the given permissions meeting the conditions in opts are granted.

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()
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 any of the given permissions meeting the conditions in opts are granted.

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()