mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-20 23:15:10 +00:00
Add InvenTreeRoleMixin
- Simplifies permission requirements for views - e.g. 'part.view' rather than 'part.view_partcategory'
This commit is contained in:
1 parent
d2e2e7511f
commit
dc2c9aa662
5 files changed
+108
-11
No files matched your search
@@ -44,6 +44,10 @@ class PartCategoryTree(TreeSerializer):
|
||||
def get_items(self):
|
||||
return PartCategory.objects.all().prefetch_related('parts', 'children')
|
||||
|
||||
permission_classes = [
|
||||
permissions.IsAuthenticated,
|
||||
]
|
||||
|
||||
|
||||
class CategoryList(generics.ListCreateAPIView):
|
||||
""" API endpoint for accessing a list of PartCategory objects.
|
||||
|
||||
Reference in new issue
Block a user