Exemplo n.º 1
0
        public AuthInfo GetAppMenuByRole(AuthRole role, int pageType = (int)TmpType.小程序专业模板, string accessUrl = null)
        {
            if (role == null)
            {
                return(new AuthInfo());
            }

            AuthGroup group = AuthGroupBLL.SingleModel.GetModel(role.GroupId);

            if (group == null)
            {
                return(new AuthInfo());
            }

            AuthInfo authInfo = new AuthInfo
            {
                AuthMenu  = group.GetAuthMenu(),
                AuthName  = role.Name,
                AuthAdmin = role,
                AllMenu   = NavMenuBLL.SingleModel.GetListByPageType(pageType) ?? new List <NavMenu>(),
                CurrRoute = accessUrl,
            };

            return(authInfo);
        }
Exemplo n.º 2
0
        public AuthInfo GetAuthMenuByRole(int pageType, int roleId, string accessUrl = null)
        {
            AuthRole  role     = GetModel(roleId);
            AuthGroup group    = AuthGroupBLL.SingleModel.GetModel(role.GroupId);
            AuthInfo  authInfo = new AuthInfo
            {
                AuthMenu  = group.GetAuthMenu(),
                AuthName  = role.Name,
                AuthAdmin = role,
                AllMenu   = role != null?NavMenuBLL.SingleModel.GetListByPageType(pageType) : new List <NavMenu>(),
                                CurrRoute = accessUrl,
            };

            return(authInfo);
        }