File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ Strict mode improves both performance and correctness:
3030Ory Network enforces fixed depth and width limits that cannot be changed in the console. If you hit a limit, contact
3131[ Ory support] ( https://www.ory.com/support ) to discuss your use case.
3232
33- ## Known breaking patterns
33+ ## Patterns that break in strict mode
3434
3535These patterns work in non-strict mode but break after enabling strict mode.
3636
Original file line number Diff line number Diff line change @@ -96,8 +96,6 @@ class File implements Namespace {
9696
9797` this.related.x.traverse(g => ...) ` iterates over the objects in relation ` x ` and evaluates the inner expression for each one.
9898
99- ** Check via a relation on the related object:**
100-
10199``` ts
102100class Group implements Namespace {
103101 related: {
@@ -117,31 +115,6 @@ class File implements Namespace {
117115
118116` view ` is granted if the subject is a member of any group in ` viewerGroups ` .
119117
120- ** Check via a permission on the related object:**
121-
122- ``` ts
123- class Group implements Namespace {
124- related: {
125- members: User []
126- }
127- permits = {
128- isMember : (ctx : Context ) => this .related .members .includes (ctx .subject ),
129- }
130- }
131-
132- class File implements Namespace {
133- related: {
134- viewerGroups: Group []
135- }
136- permits = {
137- view : (ctx : Context ) => this .related .viewerGroups .traverse ((g ) => g .permits .isMember (ctx )),
138- }
139- }
140- ```
141-
142- Same result, but delegating to a named permission on ` Group ` instead of accessing the relation directly. Use this when the
143- permission logic on the related namespace is more complex than a single ` includes ` check.
144-
145118### Boolean operators
146119
147120Combine checks with ` || ` , ` && ` , and ` ! ` :
You can’t perform that action at this time.
0 commit comments