Beispiel #1
0
        public static bool IsParallelLastApprover(string userid, FlowInfo flow)
        {
            List <string> groups = OrgMgr.GetGroups(userid);

            if (groups.Count > 0)
            {
                userid = groups[0];
            }
            return(_flow.IsLastApprover(userid, flow));
        }
Beispiel #2
0
        public static IList <ActionType> GetRequestPermission(int taskId, FlowInfo flow, RequestInfo reqInfo, string userId)
        {
            List <ActionType> actions = new List <ActionType>();

            TaskInfo ts = WorkflowMgr.GetOpenTask(taskId);

            #region taskowners' permissions
            // ReqID<0 if for new creation request, no need check open task.
            if (ts != null &&
                (ts.UID.ToLower() == userId.ToLower() ||
                 OrgMgr.GetGroups(userId).Contains(ts.UID)))
            {
                switch (flow.Status)
                {
                case FlowStatus.Created:
                    actions.Add(ActionType.Submit);
                    break;

                case FlowStatus.Submitted:
                    actions.Add(ActionType.Approve);
                    actions.Add(ActionType.Reject);
                    break;

                case FlowStatus.Approved:
                    actions.Add(ActionType.Commit);
                    break;
                }
            }

            #endregion

            #region requstor's permissions

            if (RequestMgr.IsRequestOwner(userId, reqInfo))
            {
                switch (flow.Status)
                {
                case FlowStatus.Created:
                    actions.Add(ActionType.Submit);
                    break;

                case FlowStatus.Submitted:
                case FlowStatus.Approved:
                    actions.Add(ActionType.Cancel);
                    break;

                default:
                    break;
                }
            }
            #endregion

            return(actions);
        }
        public static DataTable GetRequestsByTaskOwner(string uid)
        {
            //get all request that pending approve node
            string        group  = uid;
            List <string> groups = OrgMgr.GetGroups(uid);

            if (groups.Count > 0)
            {
                group = groups[0];
            }
            return(_request.GetRequestsByTaskOwner(uid, group));
        }