Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
40e3d8d4
authored
Jul 22, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix permission check in AclUpdateView
parent
6d5826d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
circle/dashboard/views.py
+5
-2
No files found.
circle/dashboard/views.py
View file @
40e3d8d4
...
@@ -1118,10 +1118,12 @@ class AclUpdateView(LoginRequiredMixin, View, SingleObjectMixin):
...
@@ -1118,10 +1118,12 @@ class AclUpdateView(LoginRequiredMixin, View, SingleObjectMixin):
def
check_auth
(
self
,
whom
,
old_level
,
new_level
):
def
check_auth
(
self
,
whom
,
old_level
,
new_level
):
if
isinstance
(
whom
,
Group
):
if
isinstance
(
whom
,
Group
):
if
whom
not
in
AclUpdateView
.
get_allowed_groups
(
self
.
request
.
user
):
if
(
not
self
.
is_owner
and
whom
not
in
AclUpdateView
.
get_allowed_groups
(
self
.
request
.
user
)):
return
False
return
False
elif
isinstance
(
whom
,
User
):
elif
isinstance
(
whom
,
User
):
if
whom
not
in
AclUpdateView
.
get_allowed_users
(
self
.
request
.
user
):
if
(
not
self
.
is_owner
and
whom
not
in
AclUpdateView
.
get_allowed_users
(
self
.
request
.
user
)):
return
False
return
False
return
(
return
(
AclUpdateView
.
has_next_level
(
self
.
request
.
user
,
AclUpdateView
.
has_next_level
(
self
.
request
.
user
,
...
@@ -1184,6 +1186,7 @@ class AclUpdateView(LoginRequiredMixin, View, SingleObjectMixin):
...
@@ -1184,6 +1186,7 @@ class AclUpdateView(LoginRequiredMixin, View, SingleObjectMixin):
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
self
.
instance
=
self
.
get_object
()
self
.
instance
=
self
.
get_object
()
self
.
is_owner
=
self
.
instance
.
has_level
(
request
.
user
,
'owner'
)
self
.
acl_data
=
(
self
.
instance
.
get_users_with_level
()
+
self
.
acl_data
=
(
self
.
instance
.
get_users_with_level
()
+
self
.
instance
.
get_groups_with_level
())
self
.
instance
.
get_groups_with_level
())
self
.
set_or_remove_levels
()
self
.
set_or_remove_levels
()
...
...
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