Esempio n. 1
0
        public ActionResult HeaderActions()
        {
            var model = new UserHeaderActionsViewModel
            {
                IsCanViewAdminPanel = _authorityProvider.GetProjects(new[] { Authorities.UI.Administration.Edit }).Any(),
                IsCanViewProjects   = _authorityProvider.GetProjects(new[] { Authorities.UI.Project.ProjectsList.View }).Any(),
                IsCanViewReports    = _authorityProvider.GetProjects(new[] { Authorities.UI.Reports.Run }).Any(),
                IsCanViewQueries    = _authorityProvider.GetProjects(new[] { Authorities.UI.Queries.ViewQuery }).Any()
            };

            return(PartialView(model));
        }
Esempio n. 2
0
        public ActionResult List()
        {
            var userProjects = _authorityProvider.GetProjects(new[] { Authorities.UI.Queries.CreateQuery });

            var model = new QueryListViewModel
            {
                IsCanCreateNewQuery = userProjects.Any(),
                Table = _queryService.GetList().ToModel()
            };

            return(View(model));
        }