Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
e3d065a6
Commit
e3d065a6
authored
Oct 02, 2012
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow 'is_staff' flagged user accounts to run as super-admin, which means belonging to all groups
parent
91eb2cf9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletions
+3
-1
cms/djangoapps/auth/authz.py
+2
-1
cms/djangoapps/contentstore/views.py
+1
-0
No files found.
cms/djangoapps/auth/authz.py
View file @
e3d065a6
...
...
@@ -87,7 +87,8 @@ def remove_user_from_course_group(caller, user, location, role):
def
is_user_in_course_group_role
(
user
,
location
,
role
):
if
user
.
is_active
and
user
.
is_authenticated
:
return
user
.
groups
.
filter
(
name
=
get_course_groupname_for_role
(
location
,
role
))
.
count
()
>
0
# all "is_staff" flagged accounts belong to all groups
return
user
.
is_staff
or
user
.
groups
.
filter
(
name
=
get_course_groupname_for_role
(
location
,
role
))
.
count
()
>
0
return
False
...
...
cms/djangoapps/contentstore/views.py
View file @
e3d065a6
...
...
@@ -99,6 +99,7 @@ def index(request):
def
has_access
(
user
,
location
,
role
=
EDITOR_ROLE_NAME
):
'''Return True if user allowed to access this piece of data'''
'''Note that the CMS permissions model is with respect to courses'''
'''There is a super-admin permissions if user.is_staff is set'''
return
is_user_in_course_group_role
(
user
,
get_course_location_for_item
(
location
),
role
)
...
...
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