Extend Relation Controller delete query #719
-
Hi, Does anyone know if it is possible to override or extend the relation manager delete action? I have some records which are seeded as part of the system and should be read-only, but the user is able to add their own custom records which they should be able to delete. I use a I tried to use controller middleware, but it seems it runs after the relation controller runs this method Curious if anyone knows of a way to prevent users from deleting certain records via the relation manager widget. Or other solutions that could work? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
What about using this to filter-out those records? https://wintercms.com/docs/backend/relations#extend-filter-widgets Then use this on the widget object:
|
Beta Was this translation helpful? Give feedback.
-
The RelationController also has this code:
So you should be able to use the ref. https://wintercms.com/docs/backend/relations#configuring-relation |
Beta Was this translation helpful? Give feedback.
-
Can you show how you tried to use the middleware in this case? |
Beta Was this translation helpful? Give feedback.
-
The documentation says this regarding middleware:
ref. https://wintercms.com/docs/backend/controllers-ajax#controller-middleware |
Beta Was this translation helpful? Give feedback.
-
This works for my needs: #719 (reply in thread)
Thanks for the suggestion @mjauvin |
Beta Was this translation helpful? Give feedback.
This works for my needs: #719 (reply in thread)
Thanks for the suggestion @mjauvin