mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-21 19:38:07 +00:00
feat: 工单多级审批 + 模版创建 (#6640)
* feat: 工单多级审批 + 模版创建 * feat: 工单权限处理 * fix: 工单关闭后 再审批bug * perf: 修改一点 Co-authored-by: feng626 <1304903146@qq.com> Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
from rest_framework import permissions
|
||||
|
||||
|
||||
@@ -7,12 +6,7 @@ class IsAssignee(permissions.BasePermission):
|
||||
return obj.has_assignee(request.user)
|
||||
|
||||
|
||||
class IsAssigneeOrApplicant(IsAssignee):
|
||||
class IsApplicant(permissions.BasePermission):
|
||||
|
||||
def has_object_permission(self, request, view, obj):
|
||||
return super().has_object_permission(request, view, obj) or obj.applicant == request.user
|
||||
|
||||
|
||||
class NotClosed(permissions.BasePermission):
|
||||
def has_object_permission(self, request, view, obj):
|
||||
return not obj.status_closed
|
||||
return obj.applicant == request.user
|
||||
|
Reference in New Issue
Block a user