コード例 #1
0
        public List <IviewTree> GetPermissionTree(string userId)
        {
            var seleteids = _permissionRoleUserOrganizationUnit.GetAll().Where(u => u.UserId == userId).Select(r => r.PermissionId).ToList();
            var all       = _permissionInfoRepository.GetAll().ToList();

            return(IviewTree.RecursiveQueries(all, seleteids));
        }
コード例 #2
0
        public List <IviewTree> GetRoleTree(string userId)
        {
            var seleteids = _userRoleRepository.GetAll().Where(u => u.UserId == userId).Select(r => r.RoleId).ToList();
            var all       = _roleRepository.GetAll().ToList();

            return(IviewTree.LinearQueries(all, seleteids));
        }
コード例 #3
0
        public List <IviewTree> GetOrganizationTree(string userId)
        {
            var seleteids = _organizationUnitUserRepository.GetAll().Where(u => u.UserId == userId).Select(r => r.OrganizationUnitId).ToList();
            var all       = _organizationUnitRepository.GetAll().ToList();

            return(IviewTree.RecursiveQueries(all, seleteids));
        }
コード例 #4
0
        public Task <List <IviewTree> > GetAllTree()
        {
            List <OrganizationUnitDto> all  = Repository.GetAll().AsEnumerable().Select(MapToEntityDto).ToList();
            List <IviewTree>           data = IviewTree.RecursiveQueries(all);

            return(Task.FromResult(data));
        }
コード例 #5
0
        public List <IviewTree> GetRoleTree(string organizationUnitId)
        {
            var seleteids = _organizationUnitRoleRepository.GetAll().Where(u => u.OrganizationUnitId == organizationUnitId).Select(r => r.RoleId).ToList();
            var all       = _roleRepository.GetAll().ToList();

            return(IviewTree.LinearQueries(all, seleteids));
        }
コード例 #6
0
        /// <summary>
        /// 获取当前节点下的子节点
        /// </summary>
        /// <param name="parentId"></param>
        /// <returns></returns>
        public Task <List <IviewTree> > GetPermissionByParentId(string parentId)
        {
            var list = Repository.GetAll().Where(u => u.ParentId == (parentId ?? "-1")).AsEnumerable().Select(MapToEntityDto).ToList();
            List <IviewTree> data = IviewTree.RecursiveQueries(list, parentId);

            return(Task.FromResult(data));
        }
コード例 #7
0
        public Task <List <IviewTree> > GetAllTree()
        {
            CheckGetAllPermission();
            List <PermissionInfoDto> all  = Repository.GetAll().AsEnumerable().Select(MapToEntityDto).ToList();
            List <IviewTree>         data = IviewTree.RecursiveQueries(all);

            return(Task.FromResult(data));
        }