Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
djangoldp
Manage
Activity
Members
Labels
Plan
Issues
99
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
djangoldp-packages
djangoldp
Commits
5ea8203a
Commit
5ea8203a
authored
6 years ago
by
Thibaud Duquennoy
Browse files
Options
Downloads
Patches
Plain Diff
syntax: modification in permissions.py
syntax: modification in permissions.py
parent
7d91374b
No related branches found
No related tags found
1 merge request
!36
Resolve "auto_author gives permission to everybody???"
Pipeline
#847
failed with stage
in 1 minute and 23 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
djangoldp/permissions.py
+2
-2
2 additions, 2 deletions
djangoldp/permissions.py
with
2 additions
and
2 deletions
djangoldp/permissions.py
+
2
−
2
View file @
5ea8203a
...
...
@@ -70,7 +70,7 @@ class InboxPermissions(WACPermissions):
return
super
().
has_permission
(
request
,
view
)
def
has_object_permission
(
self
,
request
,
view
,
obj
):
if
view
.
action
==
[
'
update
'
,
'
partial_update
'
,
'
destroy
'
]:
if
view
.
action
in
[
'
update
'
,
'
partial_update
'
,
'
destroy
'
]:
return
False
else
:
return
super
().
has_object_permission
(
request
,
view
)
...
...
@@ -106,7 +106,7 @@ class AnonymousReadOnly(WACPermissions):
def
has_object_permission
(
self
,
request
,
view
,
obj
):
if
view
.
action
==
"
create
"
and
request
.
user
.
is_authenticated
():
return
True
elif
view
.
action
==
[
"
list
"
,
"
retrieve
"
]:
elif
view
.
action
in
[
"
list
"
,
"
retrieve
"
]:
return
True
elif
view
.
action
in
[
'
update
'
,
'
partial_update
'
,
'
destroy
'
]:
if
hasattr
(
obj
.
_meta
,
'
auto_author
'
):
...
...
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