コード例 #1
0
ファイル: UserBLL.cs プロジェクト: MateralCMX/HuaLiangWindow
        /// <summary>
        /// 根据用户ID获得权限组信息
        /// </summary>
        /// <param name="userID">用户ID</param>
        /// <returns></returns>
        public PermissionsGroupModel GetMenuPermissionsInfoByUserID(Guid userID)
        {
            T_User userM = _dal.GetDBModelInfoByID(userID);

            Guid[] userGroupIds = (from m in userM.T_UserGroup
                                   where !m.IfDelete && m.IfEnable
                                   select m.ID).ToArray();
            PermissionsGroupModel permissionsMs = _permissionsBLL.GetHasEnablePermissionsInfoByUserGroupID(userGroupIds, PermissionsTypesEnum.Menu);

            return(permissionsMs);
        }
コード例 #2
0
ファイル: PermissionsBLL.cs プロジェクト: MateralCMX/KotenBu
        /// <summary>
        /// 根据类型和拥有权限获得权限组信息
        /// </summary>
        /// <param name="type">权限类型</param>
        /// <param name="hasIDs">拥有权限</param>
        /// <returns>权限信息</returns>
        private PermissionsGroupModel GetEnablePermissionsInfoByUserGroupIDAndTypeAndHsID(PermissionsTypesEnum type, Guid[] hasIDs, PermissionsModelModeEnum mode)
        {
            List <T_Permissions>  perInfos = _dal.GetPermissionsInfoByTypeAndEnable(type, true);
            PermissionsGroupModel tempM    = new PermissionsGroupModel
            {
                Type  = type,
                Items = PermissionsModel.GetList(perInfos, true, hasIDs, mode)
            };

            return(tempM);
        }
コード例 #3
0
        public MResultModel GetMenuInfoByLoginUser(BaseQueryModel model)
        {
            PermissionsGroupModel resM = _bll.GetMenuPermissionsInfoByUserID(model.LoginUserID);

            return(MResultModel <PermissionsGroupModel> .GetSuccessResultM(resM, "查询成功"));
        }
コード例 #4
0
 public void GetPermissionsInfoByUserIDTest()
 {
     PermissionsGroupModel resM = _userBLL.GetMenuPermissionsInfoByUserID(Guid.Parse("45C2B55C-C130-45B4-8975-A7C2BA883A29"));
 }