void set_allow_all(bool allow) { allow_all = allow; }
void set_auid(uint64_t uid) { auid = uid; }
+ bool get_allow_all() const {
+ return allow_all;
+ }
+
void encode(bufferlist& bl) const;
void decode(bufferlist::iterator& bl);
void dump(Formatter *f) const;
bool Monitor::_allowed_command(MonSession *s, const vector<string>& cmd)
{
- if (s->caps.check_privileges(PAXOS_MONMAP, MON_CAP_ALL))
- return true;
-
for (list<list<string> >::iterator p = s->caps.cmd_allow.begin();
p != s->caps.cmd_allow.end();
++p) {
}
MonSession *session = m->get_session();
- if (!session || !_allowed_command(session, m->cmd)) {
+ if (!session ||
+ (!session->caps.get_allow_all() &&
+ !_allowed_command(session, m->cmd))) {
string rs = "Access denied";
reply_command(m, -EACCES, rs, 0);
return;