summaryrefslogtreecommitdiff
path: root/tests/support
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-10 14:58:52 -0600
committermo khan <mo@mokhan.ca>2025-07-10 14:58:52 -0600
commit5d7f37c6508c7308c17659630cff35f4ead6dae4 (patch)
tree5597bde87a964d0a2625dc71f5a4015968498eef /tests/support
parente92f15ef82339d4d9dc4a04f8dce2599b6ef10da (diff)
fix: allow authenticated+authorized users to create Sparkles
Diffstat (limited to 'tests/support')
-rw-r--r--tests/support/factory_bot.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/support/factory_bot.rs b/tests/support/factory_bot.rs
index 969080a3..ba0d9c38 100644
--- a/tests/support/factory_bot.rs
+++ b/tests/support/factory_bot.rs
@@ -58,13 +58,16 @@ where
f(build_channel(addr).await)
}
-pub fn build_user(id: &str) -> cedar_policy::Entity {
+pub fn build_user(
+ id: &str,
+ attrs: std::collections::HashMap<String, cedar_policy::RestrictedExpression>,
+) -> cedar_policy::Entity {
cedar_policy::Entity::new(
cedar_policy::EntityUid::from_type_name_and_id(
cedar_policy::EntityTypeName::from_str("User").unwrap(),
cedar_policy::EntityId::from_str(id).unwrap(),
),
- std::collections::HashMap::new(),
+ attrs,
std::collections::HashSet::new(),
)
.unwrap()