Description
Hi! First of all thank you for this amazing library, it really is a joy to work with.
We are currently running into a wall when trying to augment the model actions with additional metadata, for example permissions required to execute it. We initially tried simply attaching the metadata to the descriptor, but since mobx-keystone converts these properties to wrappedAction objects internally, this data is lost. We sadly were not able to work around this when experimenting. Since we also do not have access to the model type when setting the decorator, using an external mapping also failed.
We feel like being able to get additional action metadata during runtime would bring a great benefit to this library. All while keeping the clean structure that mobx-keystone provides by also leveraging decorators:
@modelAction
@requirePermissions(['edit'])
setFoo(bar) {
...
}
Is there something we may have missed on how to implement this behavior? Thanks!