shared_account app olib tashlandi
This commit is contained in:
12
core/utils/permissions/tenant_user.py
Normal file
12
core/utils/permissions/tenant_user.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# rest framework
|
||||
from rest_framework.permissions import BasePermission
|
||||
|
||||
|
||||
class IsTenantUser(BasePermission):
|
||||
"""
|
||||
Allow access only if request.tenant_user exists.
|
||||
"""
|
||||
|
||||
def has_permission(self, request, view):
|
||||
|
||||
return bool(request.tenant_user)
|
||||
Reference in New Issue
Block a user