View Source Terminator.UUID.Performer (terminator_uuid v0.5.5)
Performer is a main actor for determining abilities
Link to this section Summary
Link to this section Types
Link to this section Functions
@spec grant(t(), Terminator.UUID.Ability.t() | Terminator.UUID.Role.t()) :: t()
Grant given grant type to a performer.
examples
Examples
Function accepts either Terminator.UUID.Ability
or Terminator.UUID.Role
grants.
Function is merging existing grants with the new ones, so calling grant with same
grants will not duplicate entries in table.
To grant particular ability to a given performer
iex> Terminator.UUID.Performer.grant(%Terminator.UUID.Performer{id: 1}, %Terminator.UUID.Ability{id: 1})
To grant particular role to a given performer
iex> Terminator.UUID.Performer.grant(%Terminator.UUID.Performer{id: 1}, %Terminator.UUID.Role{id: 1})
@spec revoke(t(), Terminator.UUID.Ability.t() | Terminator.UUID.Role.t()) :: t()
Revoke given grant type from a performer.
examples
Examples
Function accepts either Terminator.UUID.Ability
or Terminator.UUID.Role
grants.
Function is directly opposite of Terminator.UUID.Performer.grant/2
To revoke particular ability from a given performer
iex> Terminator.UUID.Performer.revoke(%Terminator.UUID.Performer{id: 1}, %Terminator.UUID.Ability{id: 1})
To revoke particular role from a given performer
iex> Terminator.UUID.Performer.revoke(%Terminator.UUID.Performer{id: 1}, %Terminator.UUID.Role{id: 1})