Exemplo n.º 1
0
 protected override void BuildAuthorizationSegments(
     AuthorizationBuilder <TContextData> authorizationBuilder,
     string[] authorizationContextPropertyNames)
 {
     authorizationContextPropertyNames
     .Where(pn => PersonEntitySpecification.IsPersonIdentifier(pn, "Student"))
     .ForEach(pn => authorizationBuilder.ClaimsMustBeAssociatedWith(pn, "ThroughEdOrgAssociation"));
 }
 protected override void BuildAuthorizationSegments(
     AuthorizationBuilder <TContextData> authorizationBuilder,
     string[] authorizationContextPropertyNames)
 {
     authorizationBuilder.ClaimsMustBeAssociatedWith(
         authorizationContextPropertyNames
         .Where(p => PersonEntitySpecification.IsPersonIdentifier(p, "Student"))
         .ToArray());
 }
Exemplo n.º 3
0
 private static PropertyType GetBasePersonUniqueIdPropertyType(EntityProperty property)
 {
     //we need to go find the correct PropertyType information by looking through
     //the incoming associations for the ones that have the USI property
     //and walking those entities until we find the person type that is the base of this
     //property, then return the entity's unique id property's property type from there.
     return(GetNestedPersonEntityProperty(property, property.PropertyName)
            .Entity.Properties
            .Where(x => !UniqueIdSpecification.IsUSI(x.PropertyName) && PersonEntitySpecification.IsPersonIdentifier(x.PropertyName))
            .Select(x => x.PropertyType)
            .Single());
 }
 public void Should_return_true_for_parent_Identifier_property()
 {
     AssertHelper.All(
         () => Assert.That(
             PersonEntitySpecification.IsPersonIdentifier(
                 nameof(NHibernateEntities.ParentAggregate.EdFi.Parent.ParentUniqueId)), Is.True)
         );
     AssertHelper.All(
         () => Assert.That(
             PersonEntitySpecification.IsPersonIdentifier(
                 nameof(NHibernateEntities.ParentAggregate.EdFi.Parent.ParentUSI)), Is.True)
         );
 }