View Source Permify.Relationship (Permify v0.1.0)

Provides some functions to manipulate the relationships.

Link to this section Summary

Functions

Delete relation tuple

Read relation tuple(s)

Create new relation tuple

Link to this section Types

@type delete_req() :: %{entity: entity(), relation: binary(), subject: subject()}
@type delete_resp() :: map()
@type entity() :: %{id: binary(), type: binary()}
@type read_req() :: %{
  filter: %{entity: entity(), relation: relation(), subject: subject()}
}
@type read_resp() :: [map()]
@type relation() :: binary()
@type schema_version() :: binary()
@type subject() :: %{
  :id => binary(),
  optional(:relation) => relation(),
  type: binary()
}
@type write_req() :: %{
  :entity => entity(),
  :relation => binary(),
  :subject => subject(),
  optional(:schema_version) => binary()
}
@type write_resp() :: map()

Link to this section Functions

@spec delete(Permify.Client.t(), delete_req()) ::
  {:ok, delete_resp()} | Permify.Client.error()

Delete relation tuple

@spec read(Permify.Client.t(), read_req()) ::
  {:ok, read_resp()} | Permify.Client.error()

Read relation tuple(s)

@spec write(Permify.Client.t(), write_req()) ::
  {:ok, write_resp()} | Permify.Client.error()

Create new relation tuple