Skip to content

Commit

Permalink
fix(api): 'hidden by access policy' error when updating policies
Browse files Browse the repository at this point in the history
This is an edgedb issue fixed by using backlinks
  • Loading branch information
hbriese committed Aug 23, 2024
1 parent 4d5202e commit e76872e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions api/src/feat/policies/existing-policies.edgeql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
with account := (select Account filter .address = <UAddress>$account),
keys := array_unpack(<array<uint16>>$policyKeys)
select Policy {
select account.<account[is Policy] {
key,
name,
approvers: { address },
Expand All @@ -26,5 +26,4 @@ select Policy {
},
allowMessages,
delay,
} filter .account = account and .key in keys and
(.isDraft if exists .draft else .isLatest)
} filter .key in keys and (.isDraft if exists .draft else .isLatest)
5 changes: 2 additions & 3 deletions api/src/feat/policies/existing-policies.query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function existingPolicies(client: Executor, args: ExistingPoliciesArgs):
return client.query(`\
with account := (select Account filter .address = <UAddress>$account),
keys := array_unpack(<array<uint16>>$policyKeys)
select Policy {
select account.<account[is Policy] {
key,
name,
approvers: { address },
Expand All @@ -71,7 +71,6 @@ select Policy {
},
allowMessages,
delay,
} filter .account = account and .key in keys and
(.isDraft if exists .draft else .isLatest)`, args);
} filter .key in keys and (.isDraft if exists .draft else .isLatest)`, args);

}

0 comments on commit e76872e

Please sign in to comment.