annacl v2.0.0 Annacl View Source

Annacl

Link to this section Summary

Link to this section Types

Specs

performer_container() :: %{
  :performer_id => integer(),
  optional(atom()) => any()
}

Link to this section Functions

Link to this function

assign_role!(parent, roles_name)

View Source

Specs

assign_role!(performer_container(), binary() | [binary()]) ::
  performer_container()

Specs

create_performer() ::
  {:ok, Annacl.Performers.Performer.t()} | {:error, Ecto.Changeset.t()}

Callback implementation for Annacl.Behaviour.RoleAndPermission.create_performer/0.

Specs

create_permission(binary()) ::
  {:ok, Annacl.Permissions.Permission.t()} | {:error, Ecto.Changeset.t()}

Callback implementation for Annacl.Behaviour.RoleAndPermission.create_permission/1.

Specs

create_role(binary()) ::
  {:ok, Annacl.Roles.Role.t()} | {:error, Ecto.Changeset.t()}

Callback implementation for Annacl.Behaviour.RoleAndPermission.create_role/1.

Specs

get_permission!(binary()) :: Annacl.Permissions.Permission.t()

Callback implementation for Annacl.Behaviour.RoleAndPermission.get_permission!/1.

Specs

get_role!(binary()) :: Annacl.Roles.Role.t()

Callback implementation for Annacl.Behaviour.RoleAndPermission.get_role!/1.

Link to this function

grant_permission!(parent, permissions_name)

View Source

Specs

grant_permission!(performer_container(), binary() | [binary()]) ::
  performer_container()
Link to this function

grant_permission_to_role!(role, permissions_name)

View Source

Specs

grant_permission_to_role!(Annacl.Roles.Role.t(), binary() | [binary()]) ::
  Annacl.Roles.Role.t()

Callback implementation for Annacl.Behaviour.RoleAndPermission.grant_permission_to_role!/2.

Link to this function

has_permission?(map, permission_name)

View Source

Specs

has_permission?(performer_container(), binary()) :: boolean()
Link to this function

has_role?(map, role_name)

View Source

Specs

has_role?(performer_container(), binary()) :: boolean()

Specs

Specs

Link to this function

remove_role!(parent, roles_name)

View Source

Specs

remove_role!(performer_container(), binary() | [binary()]) ::
  performer_container()

Specs

repo() :: any()
Link to this function

revoke_permission!(parent, permissions_name)

View Source

Specs

revoke_permission!(performer_container(), binary() | [binary()]) ::
  performer_container()
Link to this function

revoke_permission_from_role!(role, permissions_name)

View Source

Specs

revoke_permission_from_role!(Annacl.Roles.Role.t(), binary() | [binary()]) ::
  Annacl.Roles.Role.t()

Callback implementation for Annacl.Behaviour.RoleAndPermission.revoke_permission_from_role!/2.

Link to this function

role_has_permission?(role, permission_name)

View Source

Specs

role_has_permission?(Annacl.Roles.Role.t(), binary()) :: boolean()

Callback implementation for Annacl.Behaviour.RoleAndPermission.role_has_permission?/2.

Specs

superadmin_role_name() :: binary()
Link to this function

update_permission(permission, name)

View Source

Specs

Callback implementation for Annacl.Behaviour.RoleAndPermission.update_permission/2.

Specs

update_role(Annacl.Roles.Role.t(), binary()) ::
  {:ok, Annacl.Roles.Role.t()} | {:error, Ecto.Changeset.t()}

Callback implementation for Annacl.Behaviour.RoleAndPermission.update_role/2.