-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for nil
in schema
#494
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to make it something that's not a valid relation/permission name? Do we need to audit existing schemas for nil? What happens if I attempt to define a relation named nil?
internal/graph/check.go
Outdated
case *core.SetOperation_Child_XNil: | ||
requests = append(requests, notMember()) | ||
default: | ||
return checkError(errors.New("unknown set operation child in check")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you get the operation name in the error somehow? All errors should have some data that helps debug it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I wasn't sure what to print out before, but %T
seems to provide sufficient info without being too verbose
pkg/namespace/builder.go
Outdated
@@ -127,12 +127,20 @@ func setOperation(firstChild *core.SetOperation_Child, rest []*core.SetOperation | |||
} | |||
|
|||
// This creates a child for a set operation that references only direct usersets with the parent relation. | |||
// DEPRECATED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deprecated:
? https://go.dev/blog/godoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to a TODO to remove, otherwise it breaks lint
A `nil` expression under a permission is considered an empty set, and returns no permission
A
nil
expression under a permission is considered an empty set, and returns no permission