return true;
}
+bool OSDCapMatch::is_match_all() const
+{
+ if (auid >= 0)
+ return false;
+ if (pool_name.length())
+ return false;
+ if (object_prefix.length())
+ return false;
+ return true;
+}
+
ostream& operator<<(ostream& out, const OSDCapGrant& g)
{
return out << "grant(" << g.match << g.spec << ")";
bool OSDCap::allow_all() const
{
for (vector<OSDCapGrant>::const_iterator p = grants.begin(); p != grants.end(); ++p)
- if (p->match.is_match(string(), CEPH_AUTH_UID_DEFAULT, string()) && p->spec.allow_all())
+ if (p->match.is_match_all() && p->spec.allow_all())
return true;
return false;
}
* @return true if we match, false otherwise
*/
bool is_match(const std::string& pool_name, int64_t pool_auid, const std::string& object) const;
+ bool is_match_all() const;
};
ostream& operator<<(ostream& out, const OSDCapMatch& m);