private IReadOnlyCollection <SitemapNode> GetEstablishmentTabs(EstablishmentModel item, double?priority)
        {
            var urlHelper = this.Url;
            var nodes     = new List <SitemapNode>();

            nodes.Add(BuildNode("Details", "Establishment", new { area = "Establishments", id = item.Urn }, "school-dashboard", priority, SitemapFrequency.Weekly, item.LastUpdatedUtc));
            nodes.Add(BuildNode("Details", "Establishment", new { area = "Establishments", id = item.Urn }, "school-links", priority, SitemapFrequency.Weekly, item.LastUpdatedUtc));
            nodes.Add(BuildNode("Details", "Establishment", new { area = "Establishments", id = item.Urn }, "school-location", priority, SitemapFrequency.Weekly, item.LastUpdatedUtc));

            // not all establishments have the governance page displayed for the general public
            var displayPolicy = new EstablishmentDisplayEditPolicy {
                IEBTDetail = new IEBTDetailDisplayEditPolicy()
            };
            var tabPolicy = new TabDisplayPolicy(item, displayPolicy, User);

            if (tabPolicy.Governance)
            {
                nodes.Add(BuildNode("Details", "Establishment", new { area = "Establishments", id = item.Urn }, "school-governance", priority, SitemapFrequency.Weekly, item.LastUpdatedUtc));
            }

            return(nodes);
        }
Esempio n. 2
0
        public TabDisplayPolicy(EstablishmentModel model, EstablishmentDisplayEditPolicy policy, IPrincipal principal)
        {
            IEBT = policy.IEBTDetail.Any();

            Helpdesk = policy.HelpdeskNotes;

            Governance = model.TypeId.OneOfThese(
                ET.Academy1619Converter,
                ET.Academy1619SponsorLed,
                ET.AcademyAlternativeProvisionConverter,
                ET.AcademyAlternativeProvisionSponsorLed,
                ET.AcademyConverter,
                ET.AcademySpecialConverter,
                ET.AcademySpecialSponsorLed,
                ET.AcademySponsorLed,
                ET.FurtherEducation,
                ET.SixthFormCentres,
                ET.CityTechnologyCollege,
                ET.FreeSchools,
                ET.FreeSchools1619,
                ET.FreeSchoolsAlternativeProvision,
                ET.FreeSchoolsSpecial,
                ET.StudioSchools,
                ET.UniversityTechnicalCollege,
                ET.CommunitySchool,
                ET.CommunitySpecialSchool,
                ET.FoundationSchool,
                ET.FoundationSpecialSchool,
                ET.LANurserySchool,
                ET.PupilReferralUnit,
                ET.VoluntaryAidedSchool,
                ET.VoluntaryControlledSchool);

            Location = new[]
            {
                policy.RSCRegionId, policy.GovernmentOfficeRegionId, policy.AdministrativeDistrictId, policy.AdministrativeWardId, policy.ParliamentaryConstituencyId,
                policy.UrbanRuralId, policy.GSSLAId, policy.Easting, policy.Northing, policy.CASWardId, policy.MSOAId, policy.LSOAId
            }.Any(x => x == true);
        }
Esempio n. 3
0
 public TabEditPolicy(EstablishmentModel model, EstablishmentDisplayEditPolicy policy, IPrincipal principal)
 {
     Governance = !(principal.IsInRole(EdubaseRoles.ESTABLISHMENT) && model.StatusId.OneOfThese(ES.Closed));
 }