aboutsummaryrefslogtreecommitdiff
path: root/src/model/permission.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-01-03 17:22:40 +0100
committerAlex Auvolat <alex@adnab.me>2022-01-04 12:52:46 +0100
commite59c23a69df116737c428ccbfbe4dfeff4d956d5 (patch)
tree04e758a80943ba3bba9ea1e8b89867ed18dea242 /src/model/permission.rs
parent2140cd72054ac6e3a94cbe5931727159de20a97f (diff)
downloadgarage-e59c23a69df116737c428ccbfbe4dfeff4d956d5.tar.gz
garage-e59c23a69df116737c428ccbfbe4dfeff4d956d5.zip
Refactor logic for setting/unsetting aliases
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 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) {