mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
392 B
17 lines
392 B
2 years ago
|
from rest_framework import permissions
|
||
|
from common.utils import get_logger
|
||
|
|
||
|
logger = get_logger(__file__)
|
||
|
|
||
|
|
||
|
__all__ = ['IsSessionAssignee']
|
||
|
|
||
|
|
||
|
class IsSessionAssignee(permissions.BasePermission):
|
||
|
|
||
|
def has_object_permission(self, request, view, obj):
|
||
|
try:
|
||
|
return obj.ticket_relation.first().ticket.has_all_assignee(request.user)
|
||
|
except:
|
||
|
return False
|