Is it possible to DisableUpdate() based on entity details (e.g. Status)?
The DisableUpdate() method allows you to disable collection updates based on user groups using the KonstruktCollectionPermissionContext. Is it also possible to disable updates and actually hide or disable the Save button based on the entity details, entity's status for example?
Since I'm using a custom KonstruktRepository I can easily prevent any updates in the SaveImpl() method based on the entity's status. But it would be nice if the Save button would not be visible at all. At the moment users can still click the Save button and get an 'Entity saved' success notification.
Or is it possible to have SaveImpl() return an error notification instead where I could add a custom message like 'Entity can't be updated due to its status'?
We do have some permission contexts that are soure object aware, but because those DisableX permissions are set at the collection level, there is no entity context at that point.
I guess the problem is, those permissions are more "Is this collection updatable" rather than "is this entity updatable".
We may need to introduce a more granular permission for that 🤔
Is it possible to DisableUpdate() based on entity details (e.g. Status)?
The
DisableUpdate()
method allows you to disable collection updates based on user groups using theKonstruktCollectionPermissionContext
. Is it also possible to disable updates and actually hide or disable the Save button based on the entity details, entity's status for example?Since I'm using a custom KonstruktRepository I can easily prevent any updates in the
SaveImpl()
method based on the entity's status. But it would be nice if the Save button would not be visible at all. At the moment users can still click the Save button and get an 'Entity saved' success notification.Or is it possible to have
SaveImpl()
return an error notification instead where I could add a custom message like 'Entity can't be updated due to its status'?Not currently no.
We do have some permission contexts that are soure object aware, but because those
DisableX
permissions are set at the collection level, there is no entity context at that point.I guess the problem is, those permissions are more "Is this collection updatable" rather than "is this entity updatable".
We may need to introduce a more granular permission for that 🤔
In that case I'll just stick with blocking the update in the custom
SaveImpl()
method for now.is working on a reply...