Commit 6ce224de authored by Matthieu Lamalle's avatar Matthieu Lamalle

Prevent user remove from serverselection if user's role is owner

parent f848efc9
Pipeline #395 passed with stage
in 0 seconds
......@@ -560,7 +560,7 @@ class ServerRunner(ZephirCommonController):
@register_wamp('v1.serverselection.user.remove', notification_uri=None, database=True, profil_adapter='get_profil_for_serverselection')
async def remove_user_from_serverselection(self, cursor, _session_user, serverselectionid, username):
try:
if _session_user['profil'] != 'owner':
if self._get_serverselection_user_role(cursor, serverselectionid, username)['profil'] != 'owner':
return self.serverselection.remove_user_from_serverselection(cursor, serverselectionid, username)
else:
raise Exception(_('Can not remove user with role owner from serverseleciton'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment