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
6c743c54
Commit
6c743c54
authored
Aug 01, 2016
by
Adam Palay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix failing test by updating require_global_staff decorator
parent
feb042d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
lms/djangoapps/instructor/views/api.py
+6
-3
No files found.
lms/djangoapps/instructor/views/api.py
View file @
6c743c54
...
...
@@ -10,10 +10,12 @@ import json
import
logging
import
re
import
time
from
functools
import
wraps
from
django.conf
import
settings
from
django.views.decorators.csrf
import
ensure_csrf_cookie
,
csrf_exempt
from
django.views.decorators.csrf
import
ensure_csrf_cookie
from
django.views.decorators.http
import
require_POST
,
require_http_methods
from
django.views.decorators.cache
import
cache_control
from
django.contrib.auth.decorators
import
login_required
from
django.core.exceptions
import
ValidationError
,
PermissionDenied
from
django.core.mail.message
import
EmailMessage
from
django.core.exceptions
import
ObjectDoesNotExist
...
...
@@ -207,16 +209,17 @@ def require_level(level):
def
require_global_staff
(
func
):
"""View decorator that requires that the user have global staff permissions. """
@wraps
(
func
)
def
wrapped
(
request
,
*
args
,
**
kwargs
):
# pylint: disable=missing-docstring
if
GlobalStaff
()
.
has_user
(
request
.
user
):
return
func
(
request
,
*
args
,
**
kwargs
)
else
:
return
HttpResponseForbidden
(
u"Must be {platform_name} staff to perform this action."
.
format
(
platform_name
=
theming_helpers
.
get_value
(
'PLATFORM_NAME'
,
settings
.
PLATFORM_NAME
)
platform_name
=
settings
.
PLATFORM_NAME
)
)
return
wrapped
return
login_required
(
wrapped
)
def
require_sales_admin
(
func
):
...
...
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