summaryrefslogtreecommitdiff
path: root/internal/stub
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-23 12:40:12 -0600
committermo khan <mo@mokhan.ca>2025-07-23 12:40:12 -0600
commitd2ebd0a9afed57ba11f053266e6ae1edb84a0f36 (patch)
treeeb547006085f2549f2cea5773c1ec75dba47bfd0 /internal/stub
parent9674cfaedfdb8d583cfe75e1c1738a1c1d66c7f9 (diff)
feat: authorize requests to create sparkles
Diffstat (limited to 'internal/stub')
-rw-r--r--internal/stub/check.go6
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,