From e59c23a69df116737c428ccbfbe4dfeff4d956d5 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 3 Jan 2022 17:22:40 +0100 Subject: Refactor logic for setting/unsetting aliases --- src/model/permission.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/model/permission.rs') diff --git a/src/model/permission.rs b/src/model/permission.rs index ebb24a32..b8f7dd71 100644 --- a/src/model/permission.rs +++ b/src/model/permission.rs @@ -20,6 +20,17 @@ pub struct BucketKeyPerm { pub allow_owner: bool, } +impl BucketKeyPerm { + pub fn no_permissions() -> Self { + Self { + timestamp: 0, + allow_read: false, + allow_write: false, + allow_owner: false, + } + } +} + impl Crdt for BucketKeyPerm { fn merge(&mut self, other: &Self) { match other.timestamp.cmp(&self.timestamp) { -- cgit v1.2.3