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.
52 lines
1.1 KiB
52 lines
1.1 KiB
const rolePermissions = { |
|
super: '*', |
|
creator: '*', |
|
owner: '*', |
|
guest: {}, |
|
editor: { |
|
smartSheet: true, |
|
xcDatatableEditable: true, |
|
column: true, |
|
tableAttachment: true, |
|
tableRowUpdate: true, |
|
dataInsert: true, |
|
rowComments: true, |
|
gridViewOptions: true, |
|
sortSync: true, |
|
fieldsSync: true, |
|
gridColUpdate: true, |
|
filterSync: true, |
|
csvImport: true, |
|
apiDocs: true, |
|
projectSettings: true, |
|
newUser: false, |
|
}, |
|
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 Permission<T extends typeof rolePermissions = typeof rolePermissions, K extends keyof T = keyof T> = K extends |
|
| 'creator' |
|
| 'owner' |
|
? T[K] |
|
: never | T[K] extends Record<string, any> |
|
? GetKeys<T[K]> |
|
: never
|
|
|