# Struct permissions::Denial

> A failed permission or hierarchy check.

`zaun_community_protocol::permissions::Denial` · Struct

```rust
pub struct Denial { … }
```

A failed permission or hierarchy check.

## Fields

### `missing: Permissions`

Required bits the actor lacks; empty when a non-bit rule failed.

### `reason: Option<DenialReason>`

The rule that caused it, when the bits were granted but then restricted, or when a
hierarchy rule failed.

## Methods

### `hierarchy`

```rust
pub const fn hierarchy() -> Self
```

A hierarchy denial (H1, H2, H4).

### `missing`

```rust
pub const fn missing(bits: Permissions) -> Self
```

A denial for missing bits with no specific cause.

### `error_code`

```rust
pub const fn error_code(&self) -> ErrorCode
```

The response code: `TIMED_OUT` when the timeout caused it, otherwise `FORBIDDEN`.

## Trait implementations

`Clone`, `Copy`, `Debug`, `Eq`, `From<Denial>`, `Hash`, `PartialEq`, `StructuralPartialEq`

[Full rustdoc page](/docs/api/rust/zaun-community-protocol/zaun_community_protocol/permissions/denial/struct.Denial.html)
