summaryrefslogtreecommitdiffstats
path: root/src/mds/MDSAuthCaps.h
diff options
context:
space:
mode:
authorSage Weil <sage@redhat.com>2015-05-28 06:52:27 +0200
committerSage Weil <sage@redhat.com>2015-10-01 15:39:29 +0200
commit63c29adb6ced8546ea010f1ded9a2611264ced1a (patch)
treef4011e5b994e470e19a723fcd672788915e05cf0 /src/mds/MDSAuthCaps.h
parentmds/MDSAuthCaps: parse optional gid list (diff)
downloadceph-63c29adb6ced8546ea010f1ded9a2611264ced1a.tar.xz
ceph-63c29adb6ced8546ea010f1ded9a2611264ced1a.zip
mds/MDSAuthCaps: move allows() into MDSCapSpec
Also, fix this so that 'any' implies that we can read or write. Signed-off-by: Sage Weil <sage@redhat.com>
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