Files
WRNexusJS/examples/crm-app/app/authz/crm.ts
T
Clintchiz cd0dffa87d
Quality / quality (ubuntu-latest) (push) Failing after 11m17s
Quality / quality (windows-latest) (push) Canceled after 0s
feat: complete SSR CRM and refine auth UI
2026-08-20 16:17:59 +05:30

20 lines
725 B
TypeScript

import { defineAuthz } from "@wrnexus/authz";
export default defineAuthz({
permissions: {
"crm:dashboard": { title: "View dashboard" },
"contact:read": { title: "View contacts" },
"contact:write": { title: "Create and edit contacts" },
"contact:delete": { title: "Delete contacts", risk: "high" },
"deal:read": { title: "View deals" },
"deal:write": { title: "Create and edit deals" },
"admin:access": { title: "Manage CRM access", risk: "high" },
},
roles: {
viewer: ["crm:dashboard", "contact:read", "deal:read"],
"sales-rep": ["role:viewer", "contact:write", "deal:write"],
manager: ["role:sales-rep", "contact:delete"],
admin: ["role:manager", "admin:access"],
},
});