mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.0 KiB
48 lines
1.0 KiB
const rolePermissions = { |
|
creator: '*', |
|
owner: '*', |
|
guest: {}, |
|
editor: { |
|
smartSheet: true, |
|
xcDatatableEditable: true, |
|
column: true, |
|
tableAttachment: true, |
|
tableRowUpdate: true, |
|
rowComments: true, |
|
gridViewOptions: true, |
|
sortSync: true, |
|
fieldsSync: true, |
|
gridColUpdate: true, |
|
filterSync: true, |
|
csvImport: true, |
|
apiDocs: true, |
|
projectSettings: true, |
|
}, |
|
commenter: { |
|
smartSheet: true, |
|
column: true, |
|
rowComments: true, |
|
projectSettings: true, |
|
}, |
|
viewer: { |
|
smartSheet: true, |
|
column: true, |
|
projectSettings: true, |
|
}, |
|
user: { |
|
projectCreate: true, |
|
projectActions: true, |
|
projectSettings: true, |
|
}, |
|
} as const |
|
|
|
export default rolePermissions |
|
|
|
type GetKeys<T> = T extends Record<string, any> ? keyof T : never |
|
|
|
export type RolePermissions<T extends typeof rolePermissions = typeof rolePermissions, K extends keyof T = keyof T> = |
|
| T[K] extends string |
|
? T[K] |
|
: never & T[K] extends Record<string, any> |
|
? GetKeys<T[K]> |
|
: never
|
|
|