]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: Monitor: use MonCommand::requires_perm() when checking perms
authorJoao Eduardo Luis <joao@redhat.com>
Fri, 19 Sep 2014 17:04:03 +0000 (18:04 +0100)
committerJoao Eduardo Luis <joao@redhat.com>
Mon, 22 Sep 2014 16:36:29 +0000 (17:36 +0100)
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
src/mon/Monitor.cc

index 9683c128b0dcea3720e94646e10483c34be983bd..ed5d7b93258d114a5d02c6ce39189a6e99c840bf 100644 (file)
@@ -2321,9 +2321,9 @@ bool Monitor::_allowed_command(MonSession *s, string &module, string &prefix,
                                const map<string,string>& param_str_map,
                                const MonCommand *this_cmd) {
 
-  bool cmd_r = (this_cmd->req_perms.find('r') != string::npos);
-  bool cmd_w = (this_cmd->req_perms.find('w') != string::npos);
-  bool cmd_x = (this_cmd->req_perms.find('x') != string::npos);
+  bool cmd_r = this_cmd->requires_perm('r');
+  bool cmd_w = this_cmd->requires_perm('w');
+  bool cmd_x = this_cmd->requires_perm('x');
 
   bool capable = s->caps.is_capable(g_ceph_context, s->inst.name,
                                     module, prefix, param_str_map,