Merge "[Secure RBAC] Fix policy to get flavors" into stable/zed

This commit is contained in:
Zuul 2023-03-02 02:56:25 +00:00 committed by Gerrit Code Review
commit ba34718204
2 changed files with 6 additions and 2 deletions

View File

@ -47,7 +47,11 @@ rules = [
),
policy.DocumentedRuleDefault(
name='get_flavor',
check_str=base.ADMIN_OR_PROJECT_READER,
# NOTE: it can't be ADMIN_OR_PROJECT_READER constant from the base
# module because that is using "project_id" in the check string and the
# service_provider resource don't belongs to any project thus such
# check string would fail enforcement.
check_str='role:reader',
description='Get a flavor',
operations=[
{

View File

@ -23,7 +23,7 @@ class FlavorAPITestCase(base.PolicyBaseTestCase):
def setUp(self):
super(FlavorAPITestCase, self).setUp()
self.target = {'project_id': self.project_id}
self.target = {}
class SystemAdminTests(FlavorAPITestCase):