xf 5 tháng trước cách đây
mục cha
commit
4fca6ec100
1 tập tin đã thay đổi với 10 bổ sung1 xóa
  1. 10 1
      src/Hotline.Api/Controllers/OrderController.cs

+ 10 - 1
src/Hotline.Api/Controllers/OrderController.cs

@@ -4229,7 +4229,16 @@ public class OrderController : BaseController
         var isAdmin = _orderDomainService.IsCheckAdmin();
         if (!isAdmin)
         {
-            query.Where(d=>d.WorkflowSteps.Where(expStepFilter));
+            query.Where(d=>d.WorkflowSteps.Where(step =>
+                ((step.FlowAssignType == EFlowAssignType.User && !string.IsNullOrEmpty(step.HandlerId) && step.HandlerId == _sessionContext.RequiredUserId) ||
+                 (step.FlowAssignType == EFlowAssignType.Org && !string.IsNullOrEmpty(step.HandlerOrgId) && step.HandlerOrgId == _sessionContext.RequiredOrgId) ||
+                 (step.FlowAssignType == EFlowAssignType.Role && !string.IsNullOrEmpty(step.RoleId) && _sessionContext.Roles.Contains(step.RoleId)) ||
+                 (step.FlowAssignType == EFlowAssignType.OrgAndRole && !string.IsNullOrEmpty(step.RoleId)
+                                                                    && _sessionContext.Roles.Contains(step.RoleId)
+                                                                    && !string.IsNullOrEmpty(step.HandlerOrgId)
+                                                                    && step.HandlerOrgId == _sessionContext.RequiredOrgId)
+                ))
+            );
 
         }