From: Joao Eduardo Luis Date: Fri, 19 Sep 2014 17:04:03 +0000 (+0100) Subject: mon: Monitor: use MonCommand::requires_perm() when checking perms X-Git-Tag: v0.86~37^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2c5b12d9096bf7745f1aec613f796094accc3cb3;p=ceph.git mon: Monitor: use MonCommand::requires_perm() when checking perms Signed-off-by: Joao Eduardo Luis --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 9683c128b0dc..ed5d7b93258d 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -2321,9 +2321,9 @@ bool Monitor::_allowed_command(MonSession *s, string &module, string &prefix, const map& 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,