Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Arjan H. 226 posts 463 karma points c-trib
    Jan 25, 2023 @ 11:37
    Arjan H.
    0

    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'?

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jan 25, 2023 @ 11:45
    Matt Brailsford
    0

    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 🤔

  • Arjan H. 226 posts 463 karma points c-trib
    Jan 25, 2023 @ 13:01
    Arjan H.
    0

    In that case I'll just stick with blocking the update in the custom SaveImpl() method for now.

Please Sign in or register to post replies

Write your reply to:

Draft