Closed estambakio-sc closed 6 years ago
Meta-Info | Value |
---|---|
ExtProjectId | JCPROC-01 |
Original Estimation | 8h |
Remaining Estimation | 0h |
TODO: allow functions in permissions
configuration.
Current state: crud permissions are defined in modelDefinition as boolean values.
permissions: {
crudOperations: {
create: true,
edit: true,
delete: true,
view: true
}
}
Goal: crud permissions can be defined as boolean or functions (previous behavior preserved):
permissions: {
crudOperations: {
create: () => <boolean>,
edit: ({ instance }) => <boolean>,
delete: ({ instance }) => <boolean>,
view: () => <boolean>
}
},
Example of such function:
edit: arg => arg ? arg.instance.canBeEdited : true
ui.VIEW_NAME.standardOperations
will be removed, because it duplicates new permissions functionality in current application (disabling Delete
based on instance).
Tested. Navigation by instances in CRUD-editor is make correctly. Buttons of instances are displayed according permissions. Please, merge with master branch. Spent 1 hour.