|
570 | 570 | </xsl:element> |
571 | 571 | </xsl:element> |
572 | 572 | </xsl:template> |
| 573 | + <xsl:template name="NavigationRestrictionsTemplate"> |
| 574 | + <xsl:param name = "navigable" /> |
| 575 | + <xsl:element name="Annotation"> |
| 576 | + <xsl:attribute name="Term">Org.OData.Capabilities.V1.NavigationRestrictions</xsl:attribute> |
| 577 | + <xsl:element name="Record" namespace="{namespace-uri()}"> |
| 578 | + <xsl:element name="PropertyValue"> |
| 579 | + <xsl:attribute name="Property">RestrictedProperties</xsl:attribute> |
| 580 | + <xsl:element name="Collection"> |
| 581 | + <xsl:element name="Record"> |
| 582 | + <xsl:element name="PropertyValue"> |
| 583 | + <xsl:attribute name="Property">IndexableByKey</xsl:attribute> |
| 584 | + <xsl:attribute name="Bool"><xsl:value-of select = "$navigable" /></xsl:attribute> |
| 585 | + </xsl:element> |
| 586 | + </xsl:element> |
| 587 | + </xsl:element> |
| 588 | + </xsl:element> |
| 589 | + </xsl:element> |
| 590 | + </xsl:element> |
| 591 | + </xsl:template> |
573 | 592 |
|
574 | 593 | <!-- Add Navigation Restrictions Annotations --> |
575 | 594 | <xsl:template match="edm:Schema[@Namespace='microsoft.graph']"> |
|
620 | 639 | </xsl:element> |
621 | 640 | </xsl:element> |
622 | 641 | </xsl:element> |
| 642 | + |
623 | 643 | <!-- Remove indexability for joinedGroups navigation property --> |
624 | | - <xsl:element name="Annotations"> |
625 | | - <xsl:attribute name="Target">microsoft.graph.user/joinedGroups</xsl:attribute> |
626 | | - <xsl:element name="Annotation"> |
627 | | - <xsl:attribute name="Term">Org.OData.Capabilities.V1.NavigationRestrictions</xsl:attribute> |
628 | | - <xsl:element name="Record" namespace="{namespace-uri()}"> |
629 | | - <xsl:element name="PropertyValue"> |
630 | | - <xsl:attribute name="Property">RestrictedProperties</xsl:attribute> |
631 | | - <xsl:element name="Collection"> |
632 | | - <xsl:element name="Record"> |
633 | | - <xsl:element name="PropertyValue"> |
634 | | - <xsl:attribute name="Property">IndexableByKey</xsl:attribute> |
635 | | - <xsl:attribute name="Bool">false</xsl:attribute> |
636 | | - </xsl:element> |
637 | | - </xsl:element> |
638 | | - </xsl:element> |
639 | | - </xsl:element> |
| 644 | + <!-- Add the parent "Annotations" tag if it doesn't exists --> |
| 645 | + <xsl:choose> |
| 646 | + <xsl:when test="not(edm:Annotations[@Target='microsoft.graph.user/joinedGroups'])"> |
| 647 | + <xsl:element name="Annotations"> |
| 648 | + <xsl:attribute name="Target">microsoft.graph.user/joinedGroups</xsl:attribute> |
| 649 | + <xsl:call-template name="NavigationRestrictionsTemplate"> |
| 650 | + <xsl:with-param name="navigable">false</xsl:with-param> |
| 651 | + </xsl:call-template> |
640 | 652 | </xsl:element> |
641 | | - </xsl:element> |
642 | | - </xsl:element> |
| 653 | + </xsl:when> |
| 654 | + </xsl:choose> |
643 | 655 | <!-- Remove indexability for users navigation property --> |
644 | | - <xsl:element name="Annotations"> |
645 | | - <xsl:attribute name="Target">microsoft.graph.managedDevice/users</xsl:attribute> |
646 | | - <xsl:element name="Annotation"> |
647 | | - <xsl:attribute name="Term">Org.OData.Capabilities.V1.NavigationRestrictions</xsl:attribute> |
648 | | - <xsl:element name="Record" namespace="{namespace-uri()}"> |
649 | | - <xsl:element name="PropertyValue"> |
650 | | - <xsl:attribute name="Property">RestrictedProperties</xsl:attribute> |
651 | | - <xsl:element name="Collection"> |
652 | | - <xsl:element name="Record"> |
653 | | - <xsl:element name="PropertyValue"> |
654 | | - <xsl:attribute name="Property">IndexableByKey</xsl:attribute> |
655 | | - <xsl:attribute name="Bool">false</xsl:attribute> |
656 | | - </xsl:element> |
657 | | - </xsl:element> |
658 | | - </xsl:element> |
659 | | - </xsl:element> |
| 656 | + <!-- Add the parent "Annotations" tag if it doesn't exists --> |
| 657 | + <xsl:choose> |
| 658 | + <xsl:when test="not(edm:Annotations[@Target='microsoft.graph.managedDevice/users'])"> |
| 659 | + <xsl:element name="Annotations"> |
| 660 | + <xsl:attribute name="Target">microsoft.graph.managedDevice/users</xsl:attribute> |
| 661 | + <xsl:call-template name="NavigationRestrictionsTemplate"> |
| 662 | + <xsl:with-param name="navigable">false</xsl:with-param> |
| 663 | + </xsl:call-template> |
660 | 664 | </xsl:element> |
661 | | - </xsl:element> |
662 | | - </xsl:element> |
| 665 | + </xsl:when> |
| 666 | + </xsl:choose> |
663 | 667 | <!-- Remove indexability for activities navigation property --> |
664 | | - <xsl:element name="Annotations"> |
665 | | - <xsl:attribute name="Target">microsoft.graph.list/activities</xsl:attribute> |
666 | | - <xsl:element name="Annotation"> |
667 | | - <xsl:attribute name="Term">Org.OData.Capabilities.V1.NavigationRestrictions</xsl:attribute> |
668 | | - <xsl:element name="Record" namespace="{namespace-uri()}"> |
669 | | - <xsl:element name="PropertyValue"> |
670 | | - <xsl:attribute name="Property">RestrictedProperties</xsl:attribute> |
671 | | - <xsl:element name="Collection"> |
672 | | - <xsl:element name="Record"> |
673 | | - <xsl:element name="PropertyValue"> |
674 | | - <xsl:attribute name="Property">IndexableByKey</xsl:attribute> |
675 | | - <xsl:attribute name="Bool">false</xsl:attribute> |
676 | | - </xsl:element> |
677 | | - </xsl:element> |
678 | | - </xsl:element> |
679 | | - </xsl:element> |
| 668 | + <!-- Add the parent "Annotations" tag if it doesn't exists --> |
| 669 | + <xsl:choose> |
| 670 | + <xsl:when test="not(edm:Annotations[@Target='microsoft.graph.list/activities'])"> |
| 671 | + <xsl:element name="Annotations"> |
| 672 | + <xsl:attribute name="Target">microsoft.graph.list/activities</xsl:attribute> |
| 673 | + <xsl:call-template name="NavigationRestrictionsTemplate"> |
| 674 | + <xsl:with-param name="navigable">false</xsl:with-param> |
| 675 | + </xsl:call-template> |
680 | 676 | </xsl:element> |
681 | | - </xsl:element> |
682 | | - </xsl:element> |
| 677 | + </xsl:when> |
| 678 | + </xsl:choose> |
683 | 679 | <!-- Remove deletability --> |
684 | 680 | <xsl:element name="Annotations"> |
685 | 681 | <xsl:attribute name="Target">microsoft.graph.security/alerts</xsl:attribute> |
|
708 | 704 | </xsl:copy> |
709 | 705 | </xsl:template> |
710 | 706 |
|
| 707 | + <!-- If the parent "Annotations" tag already exists modify it --> |
| 708 | + <!-- Remove indexability for joinedGroups navigation property --> |
| 709 | + <!-- Remove indexability for activities navigation property --> |
| 710 | + <!-- Remove indexability for users navigation property --> |
| 711 | + <xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:Annotations[@Target='microsoft.graph.user/joinedGroups'] | |
| 712 | + edm:Schema[@Namespace='microsoft.graph']/edm:Annotations[@Target='microsoft.graph.managedDevice/users'] | |
| 713 | + edm:Schema[@Namespace='microsoft.graph']/edm:Annotations[@Target='microsoft.graph.list/activities'] "> |
| 714 | + <xsl:copy> |
| 715 | + <xsl:copy-of select="@*|node()"/> |
| 716 | + <xsl:call-template name="NavigationRestrictionsTemplate"> |
| 717 | + <xsl:with-param name="navigable">false</xsl:with-param> |
| 718 | + </xsl:call-template> |
| 719 | + </xsl:copy> |
| 720 | + </xsl:template> |
| 721 | + |
711 | 722 | <!-- Remove directoryObject Capability Annotations --> |
712 | 723 | <xsl:template match="edm:Schema[@Namespace='microsoft.graph']/edm:Annotations[@Target='microsoft.graph.directoryObject']/*[starts-with(@Term, 'Org.OData.Capabilities')]"/> |
713 | 724 |
|
|
0 commit comments