diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-23 12:40:12 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-23 12:40:12 -0600 |
| commit | d2ebd0a9afed57ba11f053266e6ae1edb84a0f36 (patch) | |
| tree | eb547006085f2549f2cea5773c1ec75dba47bfd0 /internal/stub | |
| parent | 9674cfaedfdb8d583cfe75e1c1738a1c1d66c7f9 (diff) | |
feat: authorize requests to create sparkles
Diffstat (limited to 'internal/stub')
| -rw-r--r-- | internal/stub/check.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/stub/check.go b/internal/stub/check.go index ec257e3..073b35b 100644 --- a/internal/stub/check.go +++ b/internal/stub/check.go @@ -17,7 +17,7 @@ func (m Check) CheckPermission(ctx context.Context, r *v1.CheckPermissionRequest return m(ctx, r) } -func AllowWith(t *testing.T, subject string, permission string, resource string) authz.PermissionService { +func AllowWith(t *testing.T, subject string, permission string, resource string) authz.CheckPermissionService { user := strings.SplitN(subject, ":", 2) model := strings.SplitN(resource, ":", 2) @@ -36,7 +36,7 @@ func AllowWith(t *testing.T, subject string, permission string, resource string) }) } -func Allow() authz.PermissionService { +func Allow() authz.CheckPermissionService { return Check(func(ctx context.Context, r *v1.CheckPermissionRequest) (*v1.CheckPermissionResponse, error) { return &v1.CheckPermissionResponse{ Permissionship: v1.CheckPermissionResponse_PERMISSIONSHIP_HAS_PERMISSION, @@ -44,7 +44,7 @@ func Allow() authz.PermissionService { }) } -func Deny() authz.PermissionService { +func Deny() authz.CheckPermissionService { return Check(func(ctx context.Context, r *v1.CheckPermissionRequest) (*v1.CheckPermissionResponse, error) { return &v1.CheckPermissionResponse{ Permissionship: v1.CheckPermissionResponse_PERMISSIONSHIP_NO_PERMISSION, |
