summaryrefslogtreecommitdiff
path: root/pkg/authz/spice.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/authz/spice.go')
-rw-r--r--pkg/authz/spice.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/authz/spice.go b/pkg/authz/spice.go
index 97adbd4..e563375 100644
--- a/pkg/authz/spice.go
+++ b/pkg/authz/spice.go
@@ -26,12 +26,13 @@ type CheckPermissionService interface {
CheckPermission(ctx context.Context, in *v1.CheckPermissionRequest, opts ...grpc.CallOption) (*v1.CheckPermissionResponse, error)
}
-func LoadSpiceSchema(ctx context.Context, client *authzed.Client, path string) error {
+func WriteSchema(ctx context.Context, client *authzed.Client, path string) (*v1.WriteSchemaResponse, error) {
content, err := os.ReadFile(path)
- _, err = client.WriteSchema(ctx, &v1.WriteSchemaRequest{Schema: string(content)})
if err != nil {
- return err
+ return nil, err
}
- return nil
+ return client.WriteSchema(ctx, &v1.WriteSchemaRequest{
+ Schema: string(content),
+ })
}