Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
EOLE
Zéphir
Services
Server Manager
Commits
6ce224de
Commit
6ce224de
authored
Apr 01, 2019
by
Matthieu Lamalle
Browse files
Prevent user remove from serverselection if user's role is owner
parent
f848efc9
Pipeline
#395
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
scripts/controller
View file @
6ce224de
...
...
@@ -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'
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment