// account users don't consult the existing owner/policy
if (!verify_user_permission(this, s, topic_arn,
rgw::IAM::snsCreateTopic)) {
- return -EACCES;
+ return -ERR_AUTHORIZATION;
}
return 0;
}
if (topic && !verify_topic_permission(this, s, *topic, topic_arn,
rgw::IAM::snsCreateTopic)) {
- return -EACCES;
+ return -ERR_AUTHORIZATION;
}
return 0;
}
// check account permissions up front
if (s->auth.identity->get_account() &&
!verify_user_permission(this, s, {}, rgw::IAM::snsListTopics)) {
- return -EACCES;
+ return -ERR_AUTHORIZATION;
}
return 0;
int verify_permission(optional_yield y) override {
if (!verify_topic_permission(this, s, result, topic_arn,
rgw::IAM::snsGetTopicAttributes)) {
- return -EACCES;
+ return -ERR_AUTHORIZATION;
}
return 0;
}
int verify_permission(optional_yield y) override {
if (!verify_topic_permission(this, s, result, topic_arn,
rgw::IAM::snsGetTopicAttributes)) {
- return -EACCES;
+ return -ERR_AUTHORIZATION;
}
return 0;
}
int verify_permission(optional_yield y) override {
if (!verify_topic_permission(this, s, result, topic_arn,
rgw::IAM::snsSetTopicAttributes)) {
- return -EACCES;
+ return -ERR_AUTHORIZATION;
}
return 0;
}
if (s->auth.identity->get_account()) {
if (!verify_user_permission(this, s, topic_arn,
rgw::IAM::snsDeleteTopic)) {
- return -EACCES;
+ return -ERR_AUTHORIZATION;
}
return 0;
}
if (topic && !verify_topic_permission(this, s, *topic, topic_arn,
rgw::IAM::snsDeleteTopic)) {
- return -EACCES;
+ return -ERR_AUTHORIZATION;
}
return 0;
}
try:
# 2nd user tries to override the topic
topic_arn = topic_conf2.set_config()
- assert False, "'AccessDenied' error is expected"
+ assert False, "'AuthorizationError' error is expected"
except ClientError as err:
if 'Error' in err.response:
- assert_equal(err.response['Error']['Code'], 'AccessDenied')
+ assert_equal(err.response['Error']['Code'], 'AuthorizationError')
else:
- assert_equal(err.response['Code'], 'AccessDenied')
+ assert_equal(err.response['Code'], 'AuthorizationError')
except Exception as err:
print('unexpected error type: '+type(err).__name__)
try:
# 2nd user tries to set the attribute
status = topic_conf2.set_attributes(attribute_name="persistent", attribute_val="false", topic_arn=topic_arn)
- assert False, "'AccessDenied' error is expected"
+ assert False, "'AuthorizationError' error is expected"
except ClientError as err:
if 'Error' in err.response:
- assert_equal(err.response['Error']['Code'], 'AccessDenied')
+ assert_equal(err.response['Error']['Code'], 'AuthorizationError')
else:
- assert_equal(err.response['Code'], 'AccessDenied')
+ assert_equal(err.response['Code'], 'AuthorizationError')
except Exception as err:
print('unexpected error type: '+type(err).__name__)
try:
# 2nd user tries to delete the topic
status = topic_conf2.del_config(topic_arn=topic_arn)
- assert False, "'AccessDenied' error is expected"
+ assert False, "'AuthorizationError' error is expected"
except ClientError as err:
if 'Error' in err.response:
- assert_equal(err.response['Error']['Code'], 'AccessDenied')
+ assert_equal(err.response['Error']['Code'], 'AuthorizationError')
else:
- assert_equal(err.response['Code'], 'AccessDenied')
+ assert_equal(err.response['Code'], 'AuthorizationError')
except Exception as err:
print('unexpected error type: '+type(err).__name__)
try:
# 2nd user tries to override the topic
topic_arn = topic_conf2.set_config()
- assert False, "'AccessDenied' error is expected"
+ assert False, "'AuthorizationError' error is expected"
except ClientError as err:
if 'Error' in err.response:
- assert_equal(err.response['Error']['Code'], 'AccessDenied')
+ assert_equal(err.response['Error']['Code'], 'AuthorizationError')
else:
- assert_equal(err.response['Code'], 'AccessDenied')
+ assert_equal(err.response['Code'], 'AuthorizationError')
except Exception as err:
print('unexpected error type: '+type(err).__name__)
try:
# 2nd user tries to set the attribute
status = topic_conf2.set_attributes(attribute_name="persistent", attribute_val="false", topic_arn=topic_arn)
- assert False, "'AccessDenied' error is expected"
+ assert False, "'AuthorizationError' error is expected"
except ClientError as err:
if 'Error' in err.response:
- assert_equal(err.response['Error']['Code'], 'AccessDenied')
+ assert_equal(err.response['Error']['Code'], 'AuthorizationError')
else:
- assert_equal(err.response['Code'], 'AccessDenied')
+ assert_equal(err.response['Code'], 'AuthorizationError')
except Exception as err:
print('unexpected error type: '+type(err).__name__)
try:
# 2nd user tries to delete the topic
status = topic_conf2.del_config(topic_arn=topic_arn)
- assert False, "'AccessDenied' error is expected"
+ assert False, "'AuthorizationError' error is expected"
except ClientError as err:
if 'Error' in err.response:
- assert_equal(err.response['Error']['Code'], 'AccessDenied')
+ assert_equal(err.response['Error']['Code'], 'AuthorizationError')
else:
- assert_equal(err.response['Code'], 'AccessDenied')
+ assert_equal(err.response['Code'], 'AuthorizationError')
except Exception as err:
print('unexpected error type: '+type(err).__name__)