refactor(users): lots of auth stuff added to make it more easy to manage users
Some checks failed
Build and Push LST Docker Image / docker (push) Failing after 2m9s
Some checks failed
Build and Push LST Docker Image / docker (push) Failing after 2m9s
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import { createAccessControl } from "better-auth/plugins/access";
|
||||
import { adminAc } from "better-auth/plugins/admin/access";
|
||||
import { adminAc, defaultStatements } from "better-auth/plugins/admin/access";
|
||||
|
||||
export const statement = {
|
||||
...defaultStatements,
|
||||
app: ["read", "create", "share", "update", "delete", "readAll"],
|
||||
//user: ["ban"],
|
||||
quality: ["read", "create", "share", "update", "delete", "readAll"],
|
||||
logistics: ["read", "create", "share", "update", "delete", "readAll"],
|
||||
mobile: ["read", "create", "share", "update", "delete", "readAll"],
|
||||
notifications: ["read", "create", "share", "update", "delete", "readAll"],
|
||||
} as const;
|
||||
|
||||
@@ -15,14 +17,22 @@ export const user = ac.newRole({
|
||||
notifications: ["read", "create"],
|
||||
});
|
||||
|
||||
export const manager = ac.newRole({
|
||||
app: ["read", "create", "update"],
|
||||
mobile: ["read", "create", "update"],
|
||||
});
|
||||
|
||||
export const admin = ac.newRole({
|
||||
app: ["read", "create", "update"],
|
||||
mobile: ["read", "create", "update"],
|
||||
user: ["create", "update"],
|
||||
});
|
||||
|
||||
export const systemAdmin = ac.newRole({
|
||||
app: ["read", "create", "share", "update", "delete", "readAll"],
|
||||
//user: ["ban"],
|
||||
quality: ["read", "create", "share", "update", "delete", "readAll"],
|
||||
notifications: ["read", "create", "share", "update", "delete", "readAll"],
|
||||
...adminAc.statements,
|
||||
app: ["read", "create", "share", "update", "delete", "readAll"],
|
||||
quality: ["read", "create", "share", "update", "delete", "readAll"],
|
||||
mobile: ["read", "create", "share", "update", "delete", "readAll"],
|
||||
logistics: ["read", "create", "share", "update", "delete", "readAll"],
|
||||
notifications: ["read", "create", "share", "update", "delete", "readAll"],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user