From 45f177ac9de557ed67e81ecb3f0f73c381f76297 Mon Sep 17 00:00:00 2001 From: Daniel Sainati Date: Fri, 1 Mar 2024 13:42:39 -0500 Subject: [PATCH 1/2] add example for disjoint entitlement reference --- versioned_docs/version-1.0/language/access-control.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/versioned_docs/version-1.0/language/access-control.md b/versioned_docs/version-1.0/language/access-control.md index ecdb1b6..c444f77 100644 --- a/versioned_docs/version-1.0/language/access-control.md +++ b/versioned_docs/version-1.0/language/access-control.md @@ -290,6 +290,7 @@ let r: @SomeResource = // ... let refE: auth(E) &SomeResource = // ... let refF: auth(F) &SomeResource = // ... let refEF: auth(E, F) &SomeResource = // ... +let refEOrF: auth(E | F) &SomeResource = // ... ``` The references can be used as follows: @@ -322,6 +323,13 @@ refEF.a refEF.b // valid, because `refEF` has both of the two required entitlements refEF.c + +// invalid, because `refEOrF` might not have an `E` entitlement (it may have `F` instead) +refEOrF.a +// valid, because `refEOrF` has one of the two entitlements necessary +refEOrF.b +// invalid, because `refEOrF` is only known to have one of the two required entitlements +refEOrF.c ``` Note particularly in this example how the owned value `r` can access all entitled members on `SomeResource`. From 6282a965dae0541c132d5372efa99a12e1c73e7d Mon Sep 17 00:00:00 2001 From: Daniel Sainati Date: Fri, 8 Mar 2024 14:43:39 -0500 Subject: [PATCH 2/2] add link to reference docs --- versioned_docs/version-1.0/language/access-control.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/versioned_docs/version-1.0/language/access-control.md b/versioned_docs/version-1.0/language/access-control.md index c444f77..36b5575 100644 --- a/versioned_docs/version-1.0/language/access-control.md +++ b/versioned_docs/version-1.0/language/access-control.md @@ -333,7 +333,9 @@ refEOrF.c ``` Note particularly in this example how the owned value `r` can access all entitled members on `SomeResource`. -Owned values are not affected by entitled declarations. +Owned values are not affected by entitled declarations. + +Further details about authorized references can be found [here](./references.mdx#authorized-references). ### Entitlement mappings