diff options
Diffstat (limited to 'src/rgw/rgw_admin.cc')
-rw-r--r-- | src/rgw/rgw_admin.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 9804761e8ab..edbe887c208 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -485,6 +485,7 @@ int main(int argc, char **argv) std::string infile; RGWUserAdminOpState user_op; RGWBucketAdminOpState bucket_op; + string op_mask_str; std::string val; std::ostringstream errs; @@ -513,6 +514,8 @@ int main(int argc, char **argv) pool_name = val; } else if (ceph_argparse_witharg(args, i, &val, "-o", "--object", (char*)NULL)) { object = val; + } else if (ceph_argparse_witharg(args, i, &val, "--op-mask", (char*)NULL)) { + op_mask_str = val; } else if (ceph_argparse_witharg(args, i, &val, "--key-type", (char*)NULL)) { key_type_str = val; if (key_type_str.compare("swift") == 0) { @@ -677,6 +680,17 @@ int main(int argc, char **argv) if (set_perm) user_op.set_perm(perm_mask); + if (!op_mask_str.empty()) { + uint32_t op_mask; + int ret = rgw_parse_op_type_list(op_mask_str, &op_mask); + if (ret < 0) { + cerr << "failed to parse op_mask: " << cpp_strerror(-ret) << std::endl; + return -ret; + } + + user_op.set_op_mask(op_mask); + } + if (key_type != KEY_TYPE_UNDEFINED) user_op.set_key_type(key_type); |