@fonderie/permissions 1.0.2 → 1.0.3
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.
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
-- fonderie_role_permissions: CRUD bit flags per role per resource key
|
|
2
|
+
CREATE TABLE IF NOT EXISTS fonderie_role_permissions (
|
|
3
|
+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
4
|
+
role_id UUID NOT NULL,
|
|
5
|
+
workspace_id UUID,
|
|
6
|
+
permission_key TEXT NOT NULL,
|
|
7
|
+
can_create BOOLEAN NOT NULL DEFAULT false,
|
|
8
|
+
can_read BOOLEAN NOT NULL DEFAULT false,
|
|
9
|
+
can_update BOOLEAN NOT NULL DEFAULT false,
|
|
10
|
+
can_delete BOOLEAN NOT NULL DEFAULT false,
|
|
11
|
+
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
12
|
+
UNIQUE (role_id, permission_key)
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
CREATE INDEX IF NOT EXISTS idx_frp_role_id ON fonderie_role_permissions (role_id);
|
|
16
|
+
CREATE INDEX IF NOT EXISTS idx_frp_workspace_id ON fonderie_role_permissions (workspace_id);
|
|
17
|
+
CREATE INDEX IF NOT EXISTS idx_frp_permission_key ON fonderie_role_permissions (permission_key);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonderie/permissions",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Role-based access control for SaaS — define roles, assign CRUD permissions per resource, and gate any route with requirePermission. Supports multiple roles per user via BOOL_OR aggregation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fonderie-js",
|