File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff 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.1
21+ version : 0.4.2
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
Original file line number Diff line number Diff line change @@ -131,6 +131,29 @@ class Drop implements Namespace {
131131 }
132132}
133133
134+ class Collection implements Namespace {
135+ related : {
136+ owners : User [ ]
137+ editors : User [ ]
138+ viewers : User [ ]
139+ parents : Project [ ]
140+ }
141+
142+ permits = {
143+ view : ( ctx : Context ) : boolean =>
144+ this . related . viewers . includes ( ctx . subject ) ||
145+ this . related . parents . traverse ( ( parent ) => parent . permits . view ( ctx ) ) ||
146+ this . permits . edit ( ctx ) ,
147+ edit : ( ctx : Context ) : boolean =>
148+ this . related . editors . includes ( ctx . subject ) ||
149+ this . related . parents . traverse ( ( parent ) => parent . permits . edit ( ctx ) ) ||
150+ this . permits . delete ( ctx ) ,
151+ delete : ( ctx : Context ) : boolean =>
152+ this . related . owners . includes ( ctx . subject ) ||
153+ this . related . parents . traverse ( ( parent ) => parent . permits . delete ( ctx ) ) ,
154+ }
155+ }
156+
134157class Project implements Namespace {
135158 related : {
136159 owners : User [ ]
@@ -175,4 +198,4 @@ class Organization implements Namespace {
175198 this . related . owners . includes ( ctx . subject ) ||
176199 this . related . parents . traverse ( ( parent ) => parent . permits . delete ( ctx ) ) ,
177200 }
178- }
201+ }
You can’t perform that action at this time.
0 commit comments