Skip to main content

AclStore

Trait AclStore 

Source
pub trait AclStore {
    // Required methods
    fn acl(&self, item: &str) -> Result<Option<ItemAcl>, ProviderError>;
    fn parent(&self, item: &str) -> Result<Option<String>, ProviderError>;

    // Provided method
    fn check(
        &self,
        item: &str,
        context: &Context<'_>,
        wanted: &Rights,
    ) -> Result<Decision, AclError> { ... }
}
Expand description

Where items’ ACLs and their places in a tree are kept: the consumer’s storage.

An item with its own ACL in a mode other than MostSpecific is decided by that ACL alone (inheritance was copied when it was made). Otherwise the item’s ancestors are walked: every ACL met must be MostSpecific, and an item with no ACL and no ACL above it gets Options::on_missing.

Required Methods§

Source

fn acl(&self, item: &str) -> Result<Option<ItemAcl>, ProviderError>

The ACL of item; None when it has none of its own.

§Errors

The store could not answer.

Source

fn parent(&self, item: &str) -> Result<Option<String>, ProviderError>

The item item is inside; None at the root.

§Errors

The store could not answer.

Provided Methods§

Source

fn check( &self, item: &str, context: &Context<'_>, wanted: &Rights, ) -> Result<Decision, AclError>

Whether the requester in context holds wanted on item, its ACL or its ancestors’ deciding. context’s owner is taken from each ACL met, and its item is set to item.

The walk (Proxmox’s): from the root down, a level’s entries apply when they are at the item itself (not inherit_only) or pass to containers; the requester’s own entries (account:, person:, Owner) beat the rest at that level, whose rights are unioned; a level where something applies replaces what came from above. A cancelling name refuses everything if its level is the one in force.

§Errors

AclError::Store when the store cannot answer, never a denial; AclError::Cycle when an item is its own ancestor, whatever the limits; AclError::TooDeep past Limits::depth levels; AclError::ModeMismatch for an ACL in another mode met on a walk; what Acl::check refuses.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§