* dev: remove auto script for registration * dev: make all of the instance admins as owners when adding a instance admin * dev: remove sign out endpoint * dev: update takeoff script to register the instance * dev: reapply instance model * dev: check none for instance configuration encryptions * dev: encrypting secrets configuration * dev: user workflow for registration in instances * dev: add email automation configuration * dev: remove unused imports * dev: reallign migrations * dev: reconfigure license engine registrations * dev: move email check to background worker * dev: add sign up * chore: signup error message * dev: updated onboarding workflows and instance setting * dev: updated template for magic login * chore: page migration changed * dev: updated migrations and authentication for license and update template for workspace invite --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
19 lines
506 B
Python
19 lines
506 B
Python
# Third party imports
|
|
from rest_framework.permissions import BasePermission
|
|
|
|
# Module imports
|
|
from plane.license.models import Instance, InstanceAdmin
|
|
|
|
|
|
class InstanceAdminPermission(BasePermission):
|
|
def has_permission(self, request, view):
|
|
|
|
if request.user.is_anonymous:
|
|
return False
|
|
|
|
instance = Instance.objects.first()
|
|
return InstanceAdmin.objects.filter(
|
|
role__gte=15,
|
|
instance=instance,
|
|
user=request.user,
|
|
).exists()
|