Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to disable any action on search list in CRUD editor #273

Closed
estambakio-sc opened this issue May 29, 2018 · 4 comments
Closed

Comments

@estambakio-sc
Copy link
Contributor

estambakio-sc commented May 29, 2018

Meta-Info Value
ExtProjectId JCPROC-01
Original Estimation 8h
Remaining Estimation 0h
@estambakio-sc
Copy link
Contributor Author

estambakio-sc commented Jun 6, 2018

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

@estambakio-sc estambakio-sc self-assigned this Jun 6, 2018
@estambakio-sc
Copy link
Contributor Author

ui.VIEW_NAME.standardOperations will be removed, because it duplicates new permissions functionality in current application (disabling Delete based on instance).

@estambakio-sc
Copy link
Contributor Author

Demo link

@nstoliar-sc
Copy link

nstoliar-sc commented Jun 12, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants