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

a couple of customization issues #160

Closed
doubletuna opened this issue Oct 7, 2019 · 4 comments
Closed

a couple of customization issues #160

doubletuna opened this issue Oct 7, 2019 · 4 comments

Comments

@doubletuna
Copy link

@doubletuna doubletuna commented Oct 7, 2019

Hello,

First of all, thanks for an awesome piece of software!

I'm trying to find documentation on how to disable record "Delete" action on all/some of the resources.

another issue is the addition of custom code, for some sort of an "event" log.

Cheers

DT

@doubletuna
Copy link
Author

@doubletuna doubletuna commented Oct 7, 2019

if you could update your docs @
https://softwarebrothers.github.io/admin-bro-dev/tutorial-05-actions.html

to show a full line like the below example, it would be great:
options: { name: 'X Table', actions: {show: {}, edit: {}, delete: { isVisible: false } } }

so only one issue left.. support for some sort of an "event" log, when edit occurs.

Cheers

@wojtek-krysiak
Copy link
Contributor

@wojtek-krysiak wojtek-krysiak commented Oct 8, 2019

Hi - regarding your first question;

There is something like ACTIONS - a list of all default actions: https://softwarebrothers.github.io/admin-bro-dev/AdminBro.html#.ACTIONS. you can override them for all resources in one place. So in your case:

ACTIONS.delete.isAccessible = false

Similarly, you can add an event log - by using an after hook (https://softwarebrothers.github.io/admin-bro-dev/Action.html#after) - in the function (https://softwarebrothers.github.io/admin-bro-dev/Action.html#After) you can access action, resourece, record etc.

@doubletuna
Copy link
Author

@doubletuna doubletuna commented Oct 9, 2019

Thanks!

can you provide an example for the usage of the after hook?

@wojtek-krysiak
Copy link
Contributor

@wojtek-krysiak wojtek-krysiak commented Oct 10, 2019

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

No branches or pull requests

2 participants