Adding Permission class
Note
It is advised to go through point 2 of Marking models to create REST APIs and Adding Custom Serializer and have an understanding of passing custom view attributes. Here, only example of view_params is given.
To add custom permission class, the dictionary returned by getParams() method of a ViewParams class must have an entry with key constants.PERMISSION_CLASSES. For example:
- Here, test_basics is the directory of the app
Ensure that the name of the class is passed to the decorator restifyModel() in models.py. For example:
| models.py | |
|---|---|