spine-framework 0.3.44 → 0.3.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -478,11 +478,14 @@ async function resolveHumanPrincipal(token: string, event: any): Promise<Princip
478
478
  // Load person details
479
479
  const { data: person, error: personError } = await adminDb
480
480
  .from('people')
481
- .select('*, role:role_id(slug, name, is_system, is_protected)')
481
+ .select('*, role:roles!role_id(slug, name, is_system, is_protected)')
482
482
  .eq('id', personId)
483
- .single()
483
+ .maybeSingle()
484
484
 
485
- if (personError || !person) {
485
+ if (personError) {
486
+ throw new Error('Person lookup error: ' + personError.message + ' (id: ' + personId + ')')
487
+ }
488
+ if (!person) {
486
489
  throw new Error('Person not found: ' + personId)
487
490
  }
488
491
 
@@ -404,3 +404,19 @@ CREATE TABLE public.account_paths (
404
404
  );
405
405
 
406
406
  COMMENT ON TABLE public.account_paths IS 'Stores ancestor-descendant relationships for account hierarchy traversal';
407
+
408
+ -- ============================================
409
+ -- ROLE GRANTS
410
+ -- ============================================
411
+
412
+ GRANT USAGE ON SCHEMA public TO anon, authenticated, service_role;
413
+ GRANT ALL ON ALL TABLES IN SCHEMA public TO service_role;
414
+ GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO service_role;
415
+ GRANT ALL ON ALL FUNCTIONS IN SCHEMA public TO service_role;
416
+ GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO authenticated;
417
+ GRANT SELECT ON ALL TABLES IN SCHEMA public TO anon;
418
+ ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO service_role;
419
+ ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO authenticated;
420
+ ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO anon;
421
+ ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO service_role, authenticated;
422
+ ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON FUNCTIONS TO service_role, authenticated;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spine-framework",
3
- "version": "0.3.44",
3
+ "version": "0.3.46",
4
4
  "description": "Multi-tenant, modular application platform for modern SaaS systems",
5
5
  "type": "module",
6
6
  "bin": {