From d2ebd0a9afed57ba11f053266e6ae1edb84a0f36 Mon Sep 17 00:00:00 2001 From: mo khan Date: Wed, 23 Jul 2025 12:40:12 -0600 Subject: feat: authorize requests to create sparkles --- internal/stub/check.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal') 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, -- cgit v1.2.3