Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Resint
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mike Gabriel
AlekSIS-App-Resint
Commits
52af5f8b
Verified
Commit
52af5f8b
authored
3 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Add needed scopes to LiveDocumentShowAPIView
(cherry picked from commit
ab4b4dcf
)
parent
9eb7fdd9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/resint/views.py
+9
-3
9 additions, 3 deletions
aleksis/apps/resint/views.py
with
9 additions
and
3 deletions
aleksis/apps/resint/views.py
+
9
−
3
View file @
52af5f8b
from
typing
import
Any
,
Dict
,
Type
from
typing
import
Any
,
Dict
,
List
,
Type
from
django.contrib.contenttypes.models
import
ContentType
from
django.db.models
import
QuerySet
...
...
@@ -15,7 +15,7 @@ from django.views.generic.list import ListView
from
django_tables2
import
SingleTableView
from
guardian.shortcuts
import
get_objects_for_user
from
oauth2_provider.views.mixins
import
ClientProtectedResourceMixin
from
oauth2_provider.views.mixins
import
ClientProtectedResourceMixin
,
ScopedResourceMixin
from
reversion.views
import
RevisionMixin
from
rules.contrib.views
import
PermissionRequiredMixin
...
...
@@ -241,5 +241,11 @@ class LiveDocumentShowView(PermissionRequiredMixin, LiveDocumentShowBaseView):
permission_required
=
"
resint.view_livedocument_rule
"
class
LiveDocumentShowAPIView
(
ClientProtectedResourceMixin
,
LiveDocumentShowBaseView
):
class
LiveDocumentShowAPIView
(
ScopedResourceMixin
,
ClientProtectedResourceMixin
,
LiveDocumentShowBaseView
):
"""
Show the current version of the live document in API.
"""
def
get_scopes
(
self
,
*
args
,
**
kwargs
)
->
List
[
str
]:
"""
Return the scope needed to access the PDF file.
"""
return
[
self
.
get_object
().
scope
]
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