Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
29384d1a
Commit
29384d1a
authored
4 years ago
by
stvn
Browse files
Options
Downloads
Plain Diff
Merge PR #27295 bd03/api/decorator-permissions
* Commits: fix: Stop using view_auth_classes helper in discussions API
parents
83ceefc4
fc39c3e0
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openedx/core/djangoapps/discussions/views.py
+8
-2
8 additions, 2 deletions
openedx/core/djangoapps/discussions/views.py
with
8 additions
and
2 deletions
openedx/core/djangoapps/discussions/views.py
+
8
−
2
View file @
29384d1a
"""
Handle view-logic for the djangoapp
"""
from
edx_rest_framework_extensions.auth.jwt.authentication
import
JwtAuthentication
from
edx_rest_framework_extensions.auth.session.authentication
import
SessionAuthenticationAllowInactiveUser
from
lti_consumer.models
import
LtiConfiguration
from
opaque_keys.edx.keys
import
CourseKey
from
opaque_keys
import
InvalidKeyError
...
...
@@ -8,8 +10,8 @@ from rest_framework import serializers
from
rest_framework.response
import
Response
from
rest_framework.views
import
APIView
from
openedx.core.lib.api.authentication
import
BearerAuthenticationAllowInactiveUser
from
openedx.core.lib.api.permissions
import
IsStaff
from
openedx.core.lib.api.view_utils
import
view_auth_classes
from
.models
import
DEFAULT_PROVIDER_TYPE
from
.models
import
DiscussionsConfiguration
...
...
@@ -67,11 +69,15 @@ class LtiSerializer(serializers.ModelSerializer):
return
instance
@view_auth_classes
()
class
DiscussionsConfigurationView
(
APIView
):
"""
Handle configuration-related view-logic
"""
authentication_classes
=
(
JwtAuthentication
,
BearerAuthenticationAllowInactiveUser
,
SessionAuthenticationAllowInactiveUser
)
permission_classes
=
(
IsStaff
,)
class
Serializer
(
serializers
.
ModelSerializer
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment