diff --git a/cedar-policy/CHANGELOG.md b/cedar-policy/CHANGELOG.md index d2ce58c81..3c33e20d3 100644 --- a/cedar-policy/CHANGELOG.md +++ b/cedar-policy/CHANGELOG.md @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 (#396) - `Entity::new_no_attrs()` which provides an infallible constructor for `Entity` in the case that there are no attributes. (See changes to `Entity::new()` below.) +- `RestrictedExpression::new_entity_uid()` (#442, resolving #350) ### Changed diff --git a/cedar-policy/src/api.rs b/cedar-policy/src/api.rs index a51f840cd..3fc80bb4a 100644 --- a/cedar-policy/src/api.rs +++ b/cedar-policy/src/api.rs @@ -2960,6 +2960,11 @@ impl RestrictedExpression { Self(ast::RestrictedExpr::val(value)) } + /// Create an expression representing a literal `EntityUid`. + pub fn new_entity_uid(value: EntityUid) -> Self { + Self(ast::RestrictedExpr::val(value.0)) + } + /// Create an expression representing a record. /// /// Error if any key appears two or more times in `fields`.