if ((name.compare("acl") == 0) ||
(name.compare("location") == 0) ||
+ (name.compare("logging") == 0) ||
(name.compare("delete") == 0) ||
(name.compare("uploads") == 0) ||
(name.compare("partNumber") == 0) ||
!!(s->prot_flags & RGW_REST_SWIFT), no_ns, &is_truncated, NULL);
}
+int RGWGetBucketLogging::verify_permission()
+{
+ if (s->user.user_id.compare(s->bucket_owner) != 0)
+ return -EACCES;
+
+ return 0;
+}
+
int RGWCreateBucket::verify_permission()
{
if (!rgw_user_is_authenticated(s->user))
virtual const char *name() { return "list_bucket"; }
};
+class RGWGetBucketLogging : public RGWOp {
+public:
+ RGWGetBucketLogging() {}
+ int verify_permission();
+ void execute() {}
+
+ virtual void send_response() = 0;
+ virtual const char *name() { return "get_bucket_logging"; }
+};
+
class RGWStatBucket : public RGWOp {
protected:
int ret;
rgw_flush_formatter_and_reset(s, s->formatter);
}
+void RGWGetBucketLogging_ObjStore_S3::send_response()
+{
+ dump_errno(s);
+ end_header(s, "application/xml");
+ dump_start(s);
+
+ s->formatter->open_object_section_in_ns("BucketLoggingStatus",
+ "http://doc.s3.amazonaws.com/doc/2006-03-01/");
+ s->formatter->close_section();
+ rgw_flush_formatter_and_reset(s, s->formatter);
+}
+
static void dump_bucket_metadata(struct req_state *s, RGWBucketEnt& bucket)
{
char buf[32];
RGWOp *RGWHandler_ObjStore_Bucket_S3::op_get()
{
+ if (s->args.sub_resource_exists("logging"))
+ return new RGWGetBucketLogging_ObjStore_S3;
if (is_acl_op()) {
return new RGWGetACLs_ObjStore_S3;
} else if (s->args.exists("uploadId")) {
RGWOp *RGWHandler_ObjStore_Bucket_S3::op_put()
{
+ if (s->args.sub_resource_exists("logging"))
+ return NULL;
if (is_acl_op()) {
return new RGWPutACLs_ObjStore_S3;
}
void send_response();
};
+class RGWGetBucketLogging_ObjStore_S3 : public RGWGetBucketLogging {
+public:
+ RGWGetBucketLogging_ObjStore_S3() {}
+ ~RGWGetBucketLogging_ObjStore_S3() {}
+
+ void send_response();
+};
+
class RGWStatBucket_ObjStore_S3 : public RGWStatBucket_ObjStore {
public:
RGWStatBucket_ObjStore_S3() {}