Ejemplo n.º 1
0
        public DetailViewData(FirmaSession currentFirmaSession, IRole role, List <FeaturePermission> featurePermissions, string roleName)
            : base(currentFirmaSession)
        {
            ApprovedFeatures = featurePermissions.Where(x => x.HasPermission).ToList();
            DeniedFeatures   = featurePermissions.Where(x => !x.HasPermission).ToList();

            RoleName        = roleName;
            RoleDescription = role.GetFieldDefinitionRoleDescription();

            GridSpec = new PersonWithRoleGridSpec {
                ObjectNameSingular = "Person", ObjectNamePlural = "People", SaveFiltersInCookie = true
            };
            GridName    = "PersonWithRoleGrid";
            GridDataUrl = SitkaRoute <RoleController> .BuildUrlFromExpression(tc => tc.PersonWithRoleGridJsonData(role.RoleID));

            PageTitle  = $"Role Summary for {roleName}";
            EntityName = "Role Summary";
        }
Ejemplo n.º 2
0
        public DetailViewData(Person currentPerson, IRole role)
            : base(currentPerson)
        {
            var featurePermissions = role.GetFeaturePermissions();

            ApprovedFeatures = featurePermissions.Where(x => x.HasPermission).ToList();
            DeniedFeatures   = featurePermissions.Where(x => !x.HasPermission).ToList();

            RoleName = role.GetRoleDisplayName();

            RoleDescription = role.RoleDescription;

            GridSpec = new PersonWithRoleGridSpec()
            {
                ObjectNameSingular = "Person", ObjectNamePlural = "People", SaveFiltersInCookie = true
            };
            GridName    = "PersonWithRoleGrid";
            GridDataUrl = SitkaRoute <RoleController> .BuildUrlFromExpression(tc => tc.PersonWithRoleGridJsonData(role.RoleID));

            PageTitle  = String.Format("Role Summary for {0}", RoleName);
            EntityName = "Role Summary";
        }