コード例 #1
0
        /// <summary>
        /// 是否为项目经理角色,不限参与方
        /// </summary>
        /// <param name="vault"></param>
        /// <returns></returns>
        protected internal MFilesUserGroup GetUserProjectManagerGroup(MFilesVault vault)
        {
            var userName  = GetUserName();
            var groups    = _mfusergroupService.GetGroupsByUser(vault, userName);
            var isManager = groups.FirstOrDefault(c => c.Name.Contains(ProjectRoleConstants.ProjectManager));

            return(isManager);
        }
コード例 #2
0
        /// <summary>
        /// 是否为创建项目的参与方的项目经理
        /// </summary>
        /// <param name="vault"></param>
        /// <returns></returns>
        protected static internal bool IsCreateProjectManager(MFilesVault vault, string userName, IMfUserGroupService mfusergroupService, IVaultTemplateService vautTempService)
        {
            //var userName = GetUserName();
            var mgrGroup = ProjectRoleConstants.ProjectManager;
            var groups   = mfusergroupService.GetGroupsByUser(vault, userName);
            var template = GetTemplateByTempId(vautTempService, vault.TemplateId);
            var tempDto  = template.ToDto();

            if (tempDto.HasParty)
            {
                return(groups.Any(c => c.Name == mgrGroup) && groups.Any(c => c.Name == "项目创建者"));
            }
            return(groups.Any(c => c.Name == mgrGroup));
        }