|
|
@ -6,51 +6,71 @@ export const SYSTEM_COLUMNS = ['id', 'title', 'created_at', 'updated_at'] |
|
|
|
|
|
|
|
|
|
|
|
export const BASE_URL = process.env.NC_BACKEND_URL || (process.env.NODE_ENV === 'production' ? '..' : 'http://localhost:8080') |
|
|
|
export const BASE_URL = process.env.NC_BACKEND_URL || (process.env.NODE_ENV === 'production' ? '..' : 'http://localhost:8080') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Each permission value means the following |
|
|
|
|
|
|
|
* `*` - which is wildcard, means all permissions are allowed |
|
|
|
|
|
|
|
* `include` - which is an object, means only the permissions listed in the object are allowed |
|
|
|
|
|
|
|
* `exclude` - which is an object, means all permissions are allowed except the ones listed in the object |
|
|
|
|
|
|
|
* `undefined` or `{}` - which is the default value, means no permissions are allowed |
|
|
|
|
|
|
|
* */ |
|
|
|
export const rolePermissions = { |
|
|
|
export const rolePermissions = { |
|
|
|
// general role permissions
|
|
|
|
// general role permissions
|
|
|
|
/** todo: enable wildcard permission |
|
|
|
|
|
|
|
* limited permission due to unexpected behaviour in shared base if opened in same window */ |
|
|
|
[Role.Super]: '*', |
|
|
|
[Role.Super]: { |
|
|
|
[Role.Admin]: {} as Record<string, boolean>, |
|
|
|
projectTheme: true, |
|
|
|
[Role.Guest]: {} as Record<string, boolean>, |
|
|
|
}, |
|
|
|
|
|
|
|
[Role.Admin]: {}, |
|
|
|
|
|
|
|
[Role.Guest]: {}, |
|
|
|
|
|
|
|
[Role.User]: { |
|
|
|
[Role.User]: { |
|
|
|
projectCreate: true, |
|
|
|
include: { |
|
|
|
projectActions: true, |
|
|
|
projectCreate: true, |
|
|
|
projectSettings: true, |
|
|
|
projectActions: true, |
|
|
|
|
|
|
|
projectSettings: true, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// Project role permissions
|
|
|
|
// Project role permissions
|
|
|
|
[ProjectRole.Creator]: '*', |
|
|
|
[ProjectRole.Creator]: { |
|
|
|
[ProjectRole.Owner]: '*', |
|
|
|
exclude: { |
|
|
|
|
|
|
|
appStore: true, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
[ProjectRole.Owner]: { |
|
|
|
|
|
|
|
exclude: { |
|
|
|
|
|
|
|
appStore: true, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
[ProjectRole.Editor]: { |
|
|
|
[ProjectRole.Editor]: { |
|
|
|
smartSheet: true, |
|
|
|
include: { |
|
|
|
xcDatatableEditable: true, |
|
|
|
smartSheet: true, |
|
|
|
column: true, |
|
|
|
xcDatatableEditable: true, |
|
|
|
tableAttachment: true, |
|
|
|
column: true, |
|
|
|
tableRowUpdate: true, |
|
|
|
tableAttachment: true, |
|
|
|
dataInsert: true, |
|
|
|
tableRowUpdate: true, |
|
|
|
rowComments: true, |
|
|
|
dataInsert: true, |
|
|
|
gridViewOptions: true, |
|
|
|
rowComments: true, |
|
|
|
sortSync: true, |
|
|
|
gridViewOptions: true, |
|
|
|
fieldsSync: true, |
|
|
|
sortSync: true, |
|
|
|
gridColUpdate: true, |
|
|
|
fieldsSync: true, |
|
|
|
filterSync: true, |
|
|
|
gridColUpdate: true, |
|
|
|
csvImport: true, |
|
|
|
filterSync: true, |
|
|
|
apiDocs: true, |
|
|
|
csvImport: true, |
|
|
|
projectSettings: true, |
|
|
|
apiDocs: true, |
|
|
|
newUser: false, |
|
|
|
projectSettings: true, |
|
|
|
|
|
|
|
newUser: false, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
[ProjectRole.Commenter]: { |
|
|
|
[ProjectRole.Commenter]: { |
|
|
|
smartSheet: true, |
|
|
|
include: { |
|
|
|
column: true, |
|
|
|
smartSheet: true, |
|
|
|
rowComments: true, |
|
|
|
column: true, |
|
|
|
projectSettings: true, |
|
|
|
rowComments: true, |
|
|
|
|
|
|
|
projectSettings: true, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
[ProjectRole.Viewer]: { |
|
|
|
[ProjectRole.Viewer]: { |
|
|
|
smartSheet: true, |
|
|
|
include: { |
|
|
|
column: true, |
|
|
|
smartSheet: true, |
|
|
|
projectSettings: true, |
|
|
|
column: true, |
|
|
|
|
|
|
|
projectSettings: true, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} as const |
|
|
|
} as const |
|
|
|