RGWAccessControlPolicy * const user_acl,
const int perm)
{
+ if (s->user->type == TYPE_ROLE)
+ return false;
+
/* S3 doesn't support account ACLs. */
- if ((s->user->type != TYPE_NONE || s->user->user_id == rgw_user(RGW_USER_ANON_ID)) && !user_acl)
+ if (!user_acl)
return true;
if ((perm & (int)s->perm_mask) != perm)
TYPE_NONE=0,
TYPE_RGW=1,
TYPE_KEYSTONE=2,
- TYPE_LDAP=3
+ TYPE_LDAP=3,
+ TYPE_ROLE=4
};
struct RGWUserInfo
}
// We don't need user policies in case of STS token returned by AssumeRole,
// hence the check for user type
- if (! s->user->user_id.empty() && s->user->type != TYPE_NONE) {
+ if (! s->user->user_id.empty() && s->user->type != TYPE_ROLE) {
try {
map<string, bufferlist> uattrs;
if (ret = rgw_get_user_attrs_by_uid(store, s->user->user_id, uattrs); ! ret) {
{
if (op->get_type() == RGW_OP_CREATE_BUCKET) {
// We don't need user policies in case of STS token returned by AssumeRole, hence the check for user type
- if (! s->user->user_id.empty() && s->user->type != TYPE_NONE) {
+ if (! s->user->user_id.empty() && s->user->type != TYPE_ROLE) {
try {
map<string, bufferlist> uattrs;
if (auto ret = rgw_get_user_attrs_by_uid(store, s->user->user_id, uattrs); ! ret) {
}
// This is mostly needed to assign the owner of a bucket during its creation
user_info.user_id = token.user;
+ user_info.type = token.acct_type;
}
- if (! token.user.empty() && token.acct_type != TYPE_NONE) {
+ if (! token.user.empty() && token.acct_type != TYPE_ROLE) {
// get user info
int ret = rgw_get_user_info_by_uid(store, token.user, user_info, NULL);
if (ret < 0) {
token.acct_name = {};
token.perm_mask = 0;
token.is_admin = 0;
- token.acct_type = TYPE_NONE;
+ token.acct_type = TYPE_ROLE;
}
buffer::list input, enc_output;