-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: V4.01_OS
-
Fix Version/s: None
-
Component/s: Vocabularies
-
Labels:None
-
Environment:
Proposed
-
Proposal:
-
Resolution:
Capabilities are annotated on entity sets, and for "nested" / contained entities they are expressed via Capabilities.NavigationRestrictions.
This works fine for static capabilities (can't ever update, can't ever delete), but does not allow expressing dynamic capabilities via boolean properties on the nested entities.
Example:
- Orders have (contained) items
- Each Item has a property isUpdatable
The corresponding navigation restriction is (rather bulky):
<Annotations Target="MyService.EntityContainer/Orders"> <Annotation Term="Capabilities.NavigationRestrictions"> <Record Type="Capabilities.NavigationRestrictionsType"> <PropertyValue Property="RestrictedProperties"> <Collection> <Record Type="Capabilities.NavigationPropertyRestriction"> <PropertyValue Property="NavigationProperty" NavigationPropertyPath="items"/> <PropertyValue Property="UpdateRestrictions"> <Record Type="Capabilities.UpdateRestrictionsType"> <PropertyValue Property="Updatable" Path="isUpdatable"/> </Record> </PropertyValue> </Record> </Collection> </PropertyValue> </Record> </Annotation> </Annotations>
Unfortunately the above annotation is also wrong, because 14.4.1.2 Path Evaluation states
For annotations embedded within or targeting an entity set or a singleton, the path is evaluated starting at the entity set or singleton, i.e. an empty path resolves to the entity set or singleton, and non-empty paths MUST follow the rules for annotations targeting the declared entity type of the entity set or singleton.
This means that the annotation would have to use Path="items/isUpdatable" which is a collection of Boolean values and thus not type-compatible with the Updatable property, and the connection to the concrete item that is to be updated is lost.