Expand description
Derive macro for permission enums.
Annotate a unit-only enum with #[derive(Permission)] and use the
#[permission(...)] helper attribute to declare the permission string for
each variant and the roles that should hold it by default.
ⓘ
use permkit::Permission;
#[derive(Permission)]
#[permission(roles = ["owner", "operator"])]
pub enum CompanyPermission {
#[permission(name = "Companies.List")]
List,
#[permission(name = "Companies.Create", roles = ["owner"])]
Create,
}