potree_auth/authorization/domain/
error.rs1use super::action::Action;
2use super::resource::ResourceIdentifier;
3use super::resource::ResourceType;
4use crate::user::domain::User;
5
6#[derive(Debug, Clone, thiserror::Error)]
7pub enum AuthorizationEngineError {
8 #[error("{} is not authorized to {} the {:?}: {:?}", user.name, action, resource_type, resource_identifier)]
9 NotAuthorized {
10 user: Box<User>,
11 action: Action,
12 resource_identifier: Option<ResourceIdentifier>,
13 resource_type: ResourceType,
14 },
15
16 #[error("user is not authenticated")]
17 NotAuthenticated,
18}