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.
57 lines
1.2 KiB
57 lines
1.2 KiB
2 years ago
|
const rolePermissions = {
|
||
2 years ago
|
/** todo: enable wildcard permission
|
||
|
* limited permission due to unexpected behaviour in shared base if opened in same window */
|
||
|
super: {
|
||
|
projectTheme: true,
|
||
|
},
|
||
2 years ago
|
creator: '*',
|
||
|
owner: '*',
|
||
|
guest: {},
|
||
|
editor: {
|
||
|
smartSheet: true,
|
||
|
xcDatatableEditable: true,
|
||
|
column: true,
|
||
|
tableAttachment: true,
|
||
|
tableRowUpdate: true,
|
||
2 years ago
|
dataInsert: true,
|
||
2 years ago
|
rowComments: true,
|
||
|
gridViewOptions: true,
|
||
|
sortSync: true,
|
||
|
fieldsSync: true,
|
||
|
gridColUpdate: true,
|
||
|
filterSync: true,
|
||
|
csvImport: true,
|
||
|
apiDocs: true,
|
||
|
projectSettings: true,
|
||
2 years ago
|
newUser: false,
|
||
2 years ago
|
},
|
||
|
commenter: {
|
||
|
smartSheet: true,
|
||
|
column: true,
|
||
|
rowComments: true,
|
||
|
projectSettings: true,
|
||
|
},
|
||
|
viewer: {
|
||
|
smartSheet: true,
|
||
|
column: true,
|
||
|
projectSettings: true,
|
||
|
},
|
||
|
user: {
|
||
|
projectCreate: true,
|
||
|
projectActions: true,
|
||
|
projectSettings: true,
|
||
|
},
|
||
2 years ago
|
} as const
|
||
2 years ago
|
|
||
2 years ago
|
export default rolePermissions
|
||
|
|
||
|
type GetKeys<T> = T extends Record<string, any> ? keyof T : never
|
||
|
|
||
2 years ago
|
export type Permission<T extends typeof rolePermissions = typeof rolePermissions, K extends keyof T = keyof T> = K extends
|
||
|
| 'creator'
|
||
|
| 'owner'
|
||
2 years ago
|
? T[K]
|
||
2 years ago
|
: never | T[K] extends Record<string, any>
|
||
2 years ago
|
? GetKeys<T[K]>
|
||
|
: never
|