2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 19:10:10 +00:00

Allow custom privilege levels through messages layer

If a user has created custom roles, designate custom. as
a prefix to indicate they really
mean what they say
This commit is contained in:
Jarrod Johnson 2022-11-30 11:40:36 -05:00
parent dce80de9d5
commit 58a4c22aa2

View File

@ -845,8 +845,9 @@ class InputCredential(ConfluentMessage):
inputdata['uid'] = int(inputdata['uid'])
if ('privilege_level' in inputdata and
inputdata['privilege_level'] not in self.valid_privilege_levels):
raise exc.InvalidArgumentException('privilege_level is not one of '
+ ','.join(self.valid_privilege_levels))
if not inputdata['privilege_level'].startswith('custom.'):
raise exc.InvalidArgumentException('privilege_level is not one of '
+ ','.join(self.valid_privilege_levels))
if ('enabled' in inputdata and
inputdata['enabled'] not in self.valid_enabled_values):
raise exc.InvalidArgumentException('valid values for enabled are '