aboutsummaryrefslogtreecommitdiff
path: root/src/model/permission.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/permission.rs')
-rw-r--r--src/model/permission.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/model/permission.rs b/src/model/permission.rs
index 67527ed0..1eaddf00 100644
--- a/src/model/permission.rs
+++ b/src/model/permission.rs
@@ -27,6 +27,17 @@ impl BucketKeyPerm {
allow_write: false,
allow_owner: false,
};
+
+ pub const ALL_PERMISSIONS: Self = Self {
+ timestamp: 0,
+ allow_read: true,
+ allow_write: true,
+ allow_owner: true,
+ };
+
+ pub fn is_any(&self) -> bool {
+ self.allow_read || self.allow_write || self.allow_owner
+ }
}
impl Crdt for BucketKeyPerm {