-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
A common issue for users of Administrate is that fields do not receive enough context. The most typical use case is that they cannot modify the configuration of a field depending on the current user: hiding/showing the field, showing different select options, etc.
These are some relevant issues, marked fields-context . Some of these refer directly to the lack of context, others are a bit more indirect but still related:
- How to scope dropdown options to current_user in forms #1342
- Support for virtual fields (regression) #1586
- Restricting specific fields visible in show/edit #1862
- Filtering Field::HasMany #1988
- valid_actions? doesn't work for has_many relations #2060
My initial intuition would be to pass the current controller down to fields, so that it can be used as provider of context. This can be passed in turn to the call-able that some options take, as well to new options such as hide_if or something like that.
thaichors3000, goosys, Holist, benjaminb10 and bizybHolist