1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-21 09:34:08 +03:00

Merge remote-tracking branch 'origin/v4.0'

This commit is contained in:
Adolfo Gómez García 2024-12-20 17:10:11 +01:00
commit c0faec45e6
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23
3 changed files with 16 additions and 2 deletions

View File

@ -70,6 +70,9 @@ class Permissions(Handler):
'metapools': models.MetaPool,
'accounts': models.Account,
'mfa': models.MFA,
'servers-groups': models.ServerGroup,
'tunnels-tunnels': models.ServerGroup, # Same as servers-groups, but different items
}.get(class_name, None)
if cls is None:
@ -115,6 +118,10 @@ class Permissions(Handler):
Processes get requests
"""
logger.debug('Permissions args for GET: %s', self._args)
# Update some XXX/YYYY to XXX-YYYY (as server/groups, that is a valid class name)
if len(self._args) == 3:
self._args = [self._args[0]+ '-' + self._args[1], self._args[2]]
if len(self._args) != 2:
raise exceptions.rest.RequestError('Invalid request')
@ -129,6 +136,13 @@ class Permissions(Handler):
Processes put requests
"""
logger.debug('Put args: %s', self._args)
# Update some XXX/YYYY to XXX-YYYY (as server/groups, that is a valid class name)
if len(self._args) == 6:
self._args = [self._args[0]+ '-' + self._args[1], self._args[2], self._args[3], self._args[4], self._args[5]]
if len(self._args) != 5:
raise exceptions.rest.RequestError('Invalid request')
perm = uds.core.types.permissions.PermissionType.from_str(self._params.get('perm', '0'))

File diff suppressed because one or more lines are too long

View File

@ -102,6 +102,6 @@
</svg>
</div>
</uds-root>
<link rel="modulepreload" href="/uds/res/admin/chunk-2F3F2YC2.js?stamp=1734623010" integrity="sha384-VVOra5xy5Xg9fYkBmK9MLhX7vif/MexRAaLIDBsQ4ZlkF31s/U6uWWrj+LAnvX/q"><script src="/uds/res/admin/polyfills.js?stamp=1734623010" type="module" crossorigin="anonymous" integrity="sha384-TVRkn44wOGJBeCKWJBHWLvXubZ+Julj/yA0OoEFa3LgJHVHaPeeATX6NcjuNgsIA"></script><script src="/uds/res/admin/main.js?stamp=1734623010" type="module" crossorigin="anonymous" integrity="sha384-ILkamIHuGaaiMW1mFhxAq9qPpvf9o1yomwu8HeEjJC+YVTbMBxjS0KW9n8brQ6VF"></script></body>
<link rel="modulepreload" href="/uds/res/admin/chunk-2F3F2YC2.js?stamp=1734709913" integrity="sha384-VVOra5xy5Xg9fYkBmK9MLhX7vif/MexRAaLIDBsQ4ZlkF31s/U6uWWrj+LAnvX/q"><script src="/uds/res/admin/polyfills.js?stamp=1734709913" type="module" crossorigin="anonymous" integrity="sha384-TVRkn44wOGJBeCKWJBHWLvXubZ+Julj/yA0OoEFa3LgJHVHaPeeATX6NcjuNgsIA"></script><script src="/uds/res/admin/main.js?stamp=1734709913" type="module" crossorigin="anonymous" integrity="sha384-93I2Kxdzyvq31qIfKcSe5/fBdFRg8L73nRk6uSjj5dclx4nlLL+yA0AxUBG4R6w9"></script></body>
</html>