Coverage for src/common/permissions.py: 100%

4 statements  

« prev     ^ index     » next       coverage.py v7.9.2, created at 2025-08-04 12:59 +0300

1from rest_framework.permissions import BasePermission 

2 

3 

4class IsOrderManager(BasePermission): 

5 """ 

6 Custom permission to allow only order managers to access review management. 

7 """ 

8 

9 def has_permission(self, request, view): 

10 # Check if user has the 'approve_review' permission 

11 # This permission is granted to users in the 'Reviewer' group 

12 return request.user.has_perm('products.approve_review')