Skip to content

Commit 39ec9b7

Browse files
authored
Merge branch 'master' into fix_for_after_on_nullable_foreign_key
2 parents 7ea02cc + e7c422a commit 39ec9b7

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/permissions.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,26 @@ operation is allowed.
6262
In these arguments `request` is current request, `object` is the object we are
6363
trying to add, change or delete. And `values` is a dict of the values we are
6464
trying to save. In case of `delete` this is always empty.
65+
66+
67+
### Check permissions & scoping for requests
68+
Based on whether the created endpoint accepts a `GET`, `PUT`, `POST`, ... a set of scopes is defined that need to be checked.
69+
70+
The following scopes are checked automatically when calling the following methods
71+
72+
Get scoping:
73+
- view.get_queryset()
74+
75+
Change scoping:
76+
- view.store(obj, fields, request)
77+
78+
## @no_scoping_required()
79+
In some cases you might not need the automated scoping. An example might be when your endpoint does not make any
80+
changes to the data-model but simply triggers an event or if you have already implemented custom scoping. In that
81+
case there is the option of adding `@no_scoping_required()` before the endpoint, which will ignore the scoping checks for the endpoint.
82+
83+
```python
84+
@detail_route('download', methods=['POST'])
85+
@no_scoping_required()
86+
def download(self, request, pk):
87+
```

0 commit comments

Comments
 (0)