summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-02-07 14:41:24 -0800
committerYehuda Sadeh <yehuda@inktank.com>2013-02-07 14:54:54 -0800
commit70532d198539f94067e53ef48dd7d1f5114fa27d (patch)
treee2a5b604ef1c8f0e6c5d483c4b32ae1b4a827291
parentf6af1e76a8847b105016b2d8f78a3508e838adbe (diff)
downloadceph-70532d198539f94067e53ef48dd7d1f5114fa27d.tar.gz
rgw: get bucket_owner from policy
We already read the bucket policy, we can get the bucket owner from there. Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r--src/rgw/rgw_op.cc15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc
index ad62c661ca1..a19e3b40952 100644
--- a/src/rgw/rgw_op.cc
+++ b/src/rgw/rgw_op.cc
@@ -300,22 +300,11 @@ int rgw_build_policies(RGWRados *store, struct req_state *s, bool only_bucket, b
}
s->bucket = bucket_info.bucket;
- if (s->user.user_id.compare(bucket_info.owner) != 0) {
- ret = rgw_get_user_info_by_uid(store, bucket_info.owner, bucket_owner_info);
- if (ret < 0) {
- ldout(s->cct, 0) << "NOTICE: couldn't get bucket owner info for (id=" << bucket_info.owner << ")" << dendl;
- return ret;
- }
-
- s->bucket_owner.set_id(bucket_info.owner);
- s->bucket_owner.set_name(bucket_owner_info.display_name);
- } else {
- s->bucket_owner = s->owner;
- }
-
string no_obj;
RGWAccessControlPolicy bucket_acl(s->cct);
ret = read_policy(store, s, bucket_info, s->bucket_acl, s->bucket, no_obj);
+
+ s->bucket_owner = s->bucket_acl->get_owner();
}
/* we're passed only_bucket = true when we specifically need the bucket's