# Struct `kurogane::capability::Filesystem`

```rust
pub struct Filesystem { /* private fields */ }
```

Filesystem capability configuration of named scopes and the grants that
bind origins to them.

```rust
use kurogane::Origin;
use kurogane::capability::{Filesystem, FsAccess};

let mut builder = Filesystem::builder();
let notes = builder.scope("notes", |scope| {
    scope.allow_directory_recursive("/path/to/notes");
    scope.deny_path("/path/to/notes/secrets");
    scope.deny_glob("**/.git");
});
builder.grant(Origin::parse("app://app")?, notes, FsAccess::READ | FsAccess::LIST);
let fs = builder.build()?;
```

## Associated constants

### `DEFAULT_MAX_FILE_SIZE`

```rust
const DEFAULT_MAX_FILE_SIZE: u64 = _
```

Default of [`FilesystemBuilder::max_file_size`] (64 MiB).

[`FilesystemBuilder::max_file_size`]: https://kurogane-rs.org/docs/api/capabilities/filesystembuilder.md#method.max_file_size

## Methods

### `builder`

```rust
pub fn builder() -> FilesystemBuilder
```

### `authorize`

```rust
pub fn authorize(&self, origin: &Origin) -> Option<AuthorizedFs<'_>>
```

Mints the typed authority for `origin`, or `None` when it holds no
grant. This is the only origin-dependent decision in the layer.

Source: https://github.com/0x48piraj/kurogane/blob/584c586118ee53cc04604007ee038557bd859092/kurogane/src/capability/authorized.rs#L53
