summaryrefslogtreecommitdiffstats
path: root/src/mds/MDSAuthCaps.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mds/MDSAuthCaps.h')
-rw-r--r--src/mds/MDSAuthCaps.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mds/MDSAuthCaps.h b/src/mds/MDSAuthCaps.h
index c243ef424ca..13cdc29e358 100644
--- a/src/mds/MDSAuthCaps.h
+++ b/src/mds/MDSAuthCaps.h
@@ -32,6 +32,15 @@ struct MDSCapSpec {
bool allow_all() const {
return any;
}
+ bool allows(bool r, bool w) const {
+ if (any)
+ return true;
+ if (r && !read)
+ return false;
+ if (w && !write)
+ return false;
+ return true;
+ }
};
// conditions before we are allowed to do it