Rename authz.WithSesion to authz.WithSkipAssumptionCheck since we only used it with a nil arg

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-01-16 09:41:08 +04:00
committed by Bryan Frimin
parent 5beceb58d2
commit ca4ae96f31
3 changed files with 9 additions and 6 deletions

View File

@@ -36,9 +36,11 @@ func WithAttr(key, value string) AuthorizeFuncOption {
}
}
func WithSession(sessionID *gid.GID) AuthorizeFuncOption {
// Use this option when it makes no sense to check whether the viewer is assuming the org of the accessed resource
// Example: on the viewer memberships page, we're accessing several organization names, but the viewer isn't assuming one yet.
func WithSkipAssumptionCheck() AuthorizeFuncOption {
return func(params *iam.AuthorizeParams) {
params.Session = sessionID
params.Session = nil
}
}