kustos_shared/internal/mod.rs
1// SPDX-FileCopyrightText: OpenTalk GmbH <mail@opentalk.eu>
2//
3// SPDX-License-Identifier: EUPL-1.2
4
5pub mod impls;
6
7pub trait ToCasbin {
8 fn to_casbin_policy(self) -> Vec<String>;
9}
10
11//TODO(r.floren) find better name for this. We do not want that to be part of ToCasbin as then we need to impl to_casbin_policy ofr UserPolicies<'_>
12pub trait ToCasbinMultiple {
13 fn to_casbin_policies(self) -> Vec<Vec<String>>;
14}
15
16/// This trait is used to allow different struct to be used with casbin.
17///
18/// This allows strict rules for keys in the permissions system.
19/// Similar to redis we use prefixes here to differentiate resources.
20/// E.g. `user::<UUID>` and `group::<ID>`
21pub trait ToCasbinString {
22 fn to_casbin_string(self) -> String;
23}