Beispiel #1
0
    /// <summary>
    /// 管理他人数据权限验证
    /// </summary>
    public bool ValidateDataPermission(int recordEmpId)
    {
        if (this.itemNo == "")
        {
            return true;
        }

        bool ret = false;
        //操作人与记录携带者为同一人
        if (this.currentUser.empId == recordEmpId)
        {
            ret = true;
        }
        else
        {
            STreeData treeData = this.GetTreeData(this.itemNo);
            //判断当前模块是否允许管理他人数据
            //判断当前人员对当前模块是否有管理权限
            if (treeData.isAlowManageOtherData && this.IsHavePermissions(this.itemNo, "manage"))
            {
                ret = true;
            }
            else
            {
                //判断是否走负责部门
                //判断记录携带者是否在当前人员的负责部门范围之内
                using (HEemployeeBB employeeBB = new HEemployeeBB())
                {
                    if (treeData.isManageDepart && employeeBB.IsManage(this.currentUser.empId, this.itemNo, this.permissionsTypeNo, recordEmpId))
                    {
                        ret = true;
                    }
                }
            }
        }
        return ret;
    }