# `Ory.Api.Permission`

API calls for all endpoints tagged `Permission`.

# `batch_check_permission`

```elixir
@spec batch_check_permission(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, Ory.Model.ErrorGeneric.t()}
  | {:ok, Ory.Model.BatchCheckPermissionResult.t()}
  | {:error, Tesla.Env.t()}
```

Batch check permissions
To learn how relationship tuples and the check works, head over to [the documentation](https://www.ory.com/docs/keto/concepts/api-overview).

### Parameters

- `connection` (Ory.Connection): Connection to server
- `opts` (keyword): Optional parameters
  - `:"max-depth"` (integer()): 
  - `:body` (BatchCheckPermissionBody): 

### Returns

- `{:ok, Ory.Model.BatchCheckPermissionResult.t}` on success
- `{:error, Tesla.Env.t}` on failure

# `check_permission`

```elixir
@spec check_permission(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, Ory.Model.CheckPermissionResult.t()}
  | {:ok, Ory.Model.ErrorGeneric.t()}
  | {:error, Tesla.Env.t()}
```

Check a permission
To learn how relationship tuples and the check works, head over to [the documentation](https://www.ory.com/docs/keto/concepts/api-overview).

### Parameters

- `connection` (Ory.Connection): Connection to server
- `opts` (keyword): Optional parameters
  - `:namespace` (String.t): Namespace of the Relationship
  - `:object` (String.t): Object of the Relationship
  - `:relation` (String.t): Relation of the Relationship
  - `:subject_id` (String.t): SubjectID of the Relationship
  - `:"subject_set.namespace"` (String.t): Namespace of the Subject Set
  - `:"subject_set.object"` (String.t): Object of the Subject Set
  - `:"subject_set.relation"` (String.t): Relation of the Subject Set
  - `:"max-depth"` (integer()): 

### Returns

- `{:ok, Ory.Model.CheckPermissionResult.t}` on success
- `{:error, Tesla.Env.t}` on failure

# `check_permission_or_error`

```elixir
@spec check_permission_or_error(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, Ory.Model.CheckPermissionResult.t()}
  | {:ok, Ory.Model.ErrorGeneric.t()}
  | {:error, Tesla.Env.t()}
```

Check a permission
To learn how relationship tuples and the check works, head over to [the documentation](https://www.ory.com/docs/keto/concepts/api-overview).

### Parameters

- `connection` (Ory.Connection): Connection to server
- `opts` (keyword): Optional parameters
  - `:namespace` (String.t): Namespace of the Relationship
  - `:object` (String.t): Object of the Relationship
  - `:relation` (String.t): Relation of the Relationship
  - `:subject_id` (String.t): SubjectID of the Relationship
  - `:"subject_set.namespace"` (String.t): Namespace of the Subject Set
  - `:"subject_set.object"` (String.t): Object of the Subject Set
  - `:"subject_set.relation"` (String.t): Relation of the Subject Set
  - `:"max-depth"` (integer()): 

### Returns

- `{:ok, Ory.Model.CheckPermissionResult.t}` on success
- `{:error, Tesla.Env.t}` on failure

# `expand_permissions`

```elixir
@spec expand_permissions(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, Ory.Model.ErrorGeneric.t()}
  | {:ok, Ory.Model.ExpandedPermissionTree.t()}
  | {:error, Tesla.Env.t()}
```

Expand a Relationship into permissions.
Use this endpoint to expand a relationship tuple into permissions.

### Parameters

- `connection` (Ory.Connection): Connection to server
- `namespace` (String.t): Namespace of the Subject Set
- `object` (String.t): Object of the Subject Set
- `relation` (String.t): Relation of the Subject Set
- `opts` (keyword): Optional parameters
  - `:"max-depth"` (integer()): 

### Returns

- `{:ok, Ory.Model.ExpandedPermissionTree.t}` on success
- `{:error, Tesla.Env.t}` on failure

# `post_check_permission`

```elixir
@spec post_check_permission(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, Ory.Model.CheckPermissionResult.t()}
  | {:ok, Ory.Model.ErrorGeneric.t()}
  | {:error, Tesla.Env.t()}
```

Check a permission
To learn how relationship tuples and the check works, head over to [the documentation](https://www.ory.com/docs/keto/concepts/api-overview).

### Parameters

- `connection` (Ory.Connection): Connection to server
- `opts` (keyword): Optional parameters
  - `:"max-depth"` (integer()): 
  - `:body` (PostCheckPermissionBody): 

### Returns

- `{:ok, Ory.Model.CheckPermissionResult.t}` on success
- `{:error, Tesla.Env.t}` on failure

# `post_check_permission_or_error`

```elixir
@spec post_check_permission_or_error(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, Ory.Model.CheckPermissionResult.t()}
  | {:ok, Ory.Model.ErrorGeneric.t()}
  | {:error, Tesla.Env.t()}
```

Check a permission
To learn how relationship tuples and the check works, head over to [the documentation](https://www.ory.com/docs/keto/concepts/api-overview).

### Parameters

- `connection` (Ory.Connection): Connection to server
- `opts` (keyword): Optional parameters
  - `:"max-depth"` (integer()): 
  - `:body` (PostCheckPermissionOrErrorBody): 

### Returns

- `{:ok, Ory.Model.CheckPermissionResult.t}` on success
- `{:error, Tesla.Env.t}` on failure

---

*Consult [api-reference.md](api-reference.md) for complete listing*
