Skip to content

Commit 3b3eab1

Browse files
authored
Merge pull request #140 from holaplex/mpw/keto-namespace-update
remove recursion and traverse in Organization Namespace, add explicit…
2 parents 2e05176 + d01812a commit 3b3eab1

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

charts/hub-permissions/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type: application
1818
# This is the chart version. This version number should be incremented each time you make changes
1919
# to the chart and its templates, including the app version.
2020
# Versions are expected to follow Semantic Versioning (https://semver.org/)
21-
version: 0.4.4
21+
version: 0.4.5
2222

2323
# This is the version number of the application being deployed. This version number should be
2424
# incremented each time you make changes to the application. Versions are not expected to

charts/hub-permissions/policies/namespaces.keto.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,20 +205,18 @@ class Organization implements Namespace {
205205
owners: User[]
206206
editors: User[]
207207
viewers: User[]
208-
parents: Organization[]
209208
}
210209

211210
permits = {
212211
view: (ctx: Context): boolean =>
213212
this.related.viewers.includes(ctx.subject) ||
213+
this.related.owners.includes(ctx.subject) ||
214214
this.permits.edit(ctx),
215215
edit: (ctx: Context): boolean =>
216216
this.related.editors.includes(ctx.subject) ||
217-
this.permits.delete(ctx),
218-
invite: (ctx: Context): boolean =>
219-
this.permits.view(ctx),
220-
delete: (ctx: Context): boolean =>
221217
this.related.owners.includes(ctx.subject) ||
222-
this.related.parents.traverse((parent) => parent.permits.delete(ctx)),
218+
this.permits.delete(ctx),
219+
invite: (ctx: Context): boolean => this.permits.view(ctx),
220+
delete: (ctx: Context): boolean => this.related.owners.includes(ctx.subject),
223221
}
224222
}

0 commit comments

Comments
 (0)