ldpp_dout(s, 2) << "verifying op permissions" << dendl;
ret = op->verify_permission(null_yield);
if (ret < 0) {
- if (s->system_request) {
- ldpp_dout(op, 2) << "overriding permissions due to system operation" << dendl;
- } else if (s->auth.identity->is_admin()) {
+ if (s->auth.identity->is_admin()) {
ldpp_dout(op, 2) << "overriding permissions due to admin operation" << dendl;
} else {
abort_req(s, op, ret);
ldpp_dout(s, 2) << "verifying op permissions" << dendl;
ret = op->verify_permission(null_yield);
if (ret < 0) {
- if (s->system_request) {
- ldpp_dout(op, 2) << "overriding permissions due to system operation" << dendl;
- } else if (s->auth.identity->is_admin()) {
+ if (s->auth.identity->is_admin()) {
ldpp_dout(op, 2) << "overriding permissions due to admin operation" << dendl;
} else {
abort_req(s, op, ret);
rgw_bucket& bucket,
optional_yield y)
{
- if (!s->system_request && bucket_info.flags & BUCKET_SUSPENDED) {
+ if (!s->auth.identity->is_admin() && bucket_info.flags & BUCKET_SUSPENDED) {
ldpp_dout(dpp, 0) << "NOTICE: bucket " << bucket_info.bucket.name
<< " is suspended" << dendl;
return -ERR_USER_SUSPENDED;
std::unique_ptr<rgw::sal::Object> mpobj;
rgw_obj obj;
- if (!s->system_request && bucket_info.flags & BUCKET_SUSPENDED) {
+ if (!s->auth.identity->is_admin() && bucket_info.flags & BUCKET_SUSPENDED) {
ldpp_dout(dpp, 0) << "NOTICE: bucket " << bucket_info.bucket.name
<< " is suspended" << dendl;
return -ERR_USER_SUSPENDED;
// send a PutBucketPolicy or DeleteBucketPolicy request as an admin/system
// user. We can allow such requests, because even if the policy denied
// access, admin/system users override that error from verify_permission().
- if (!s->system_request) {
+ if (!s->auth.identity->is_admin()) {
ret = -EACCES;
}
}
/* We can use global user_acl because LOs cannot have segments
* stored inside different accounts. */
- if (s->system_request) {
- ldpp_dout(this, 2) << "overriding permissions due to system operation" << dendl;
- } else if (s->auth.identity->is_admin()) {
+ if (s->auth.identity->is_admin()) {
ldpp_dout(this, 2) << "overriding permissions due to admin operation" << dendl;
} else if (!verify_object_permission(this, s, part->get_obj(), s->user_acl,
bucket_acl, obj_policy, bucket_policy,