uint32_t RGWAccessControlPolicy::get_perm(const DoutPrefixProvider* dpp,
const rgw::auth::Identity& auth_identity,
const uint32_t perm_mask,
- const char * const http_referer)
+ const char * const http_referer,
+ bool ignore_public_acls)
{
ldpp_dout(dpp, 20) << "-- Getting permissions begin with perm_mask=" << perm_mask
<< dendl;
}
/* should we continue looking up? */
- if ((perm & perm_mask) != perm_mask) {
+ if (!ignore_public_acls && ((perm & perm_mask) != perm_mask)) {
perm |= acl.get_group_perm(ACL_GROUP_ALL_USERS, perm_mask);
if (false == auth_identity.is_owner_of(rgw_user(RGW_USER_ANON_ID))) {
const rgw::auth::Identity& auth_identity,
const uint32_t user_perm_mask,
const uint32_t perm,
- const char * const http_referer)
+ const char * const http_referer,
+ bool ignore_public_acls)
{
uint32_t test_perm = perm | RGW_PERM_READ_OBJS | RGW_PERM_WRITE_OBJS;
- uint32_t policy_perm = get_perm(dpp, auth_identity, test_perm, http_referer);
+ uint32_t policy_perm = get_perm(dpp, auth_identity, test_perm, http_referer, ignore_public_acls);
/* the swift WRITE_OBJS perm is equivalent to the WRITE obj, just
convert those bits. Note that these bits will only be set on
uint32_t get_perm(const DoutPrefixProvider* dpp,
const rgw::auth::Identity& auth_identity,
uint32_t perm_mask,
- const char * http_referer);
+ const char * http_referer,
+ bool ignore_public_acls=false);
bool verify_permission(const DoutPrefixProvider* dpp,
const rgw::auth::Identity& auth_identity,
uint32_t user_perm_mask,
uint32_t perm,
- const char * http_referer = nullptr);
+ const char * http_referer = nullptr,
+ bool ignore_public_acls=false);
void encode(bufferlist& bl) const {
ENCODE_START(2, 2, bl);
return false;
}
- bool ret = object_acl->verify_permission(dpp, *s->identity, s->perm_mask, perm);
+ bool ret = object_acl->verify_permission(dpp, *s->auth.identity, s->perm_mask, perm,
+ nullptr, /* http_referrer */
+ s->bucket_access_conf &&
+ s->bucket_access_conf->ignore_public_acls());
if (ret) {
return true;
}
return false;
}
- bool ret = object_acl->verify_permission(dpp, *s->identity, s->perm_mask, perm);
+ bool ret = object_acl->verify_permission(dpp, *s->auth.identity, s->perm_mask, perm,
+ nullptr, /* http referrer */
+ s->bucket_access_conf &&
+ s->bucket_access_conf->ignore_public_acls());
if (ret) {
return true;
}