How to disable the Lock button using a method during a Form OnLoad event

So here is my scenario...

We are going to have users maintaining some Lists in Aras but we only want the user to be able to edit their lists and only their lists based on identity of the user logged in.

For example:

I could have the lists:    "Available Design Materials" and "Design Shapes"

and the identities: "Metal Work Management" and "Design Department Administration"

Lets say "Available Design Materials" belongs to "Metal Work Management" and the list "Design Shapes" belongs to "Design Department Administration"

If a member of the identity "Metal Work Management" is logged in they can add or remove values from the list "Available Design Materials" but they can not edit "Design Shapes" while the identity "Design Department Administration" can edit the list "Design Shapes" but not the list "Available Design Materials".  The way I'm purposing controlling this is to add a relationship to the List itemtype called Can Edit that connects to the Identity itemtype when the list form loads I want to read the Can Edit relationship and see what identities have access to edit this particular list and if the user is not part of one of those identities disable the lock button as though the user only has view permissions on the List itemtype. So far I am able to flip through my relationship and return a true/false depending if the user is apart of the identities in the Can Edit relationship but I cannot figure out how to see the toolbar buttons from the method or how to disable the lock button.

  • Hi Phinnix,

    This kind of dynamic Permission model is already built into Aras Innovator without needing to add any custom logic or relationships. There are two system Identities called Owner and Manager that correspond to the identities set as an item's owned_by_id or managed_by_id. Any permissions given to the Owner Identity will be given to any Identity set as an item's owned_by_id. The same holds true for the Manager identity and the managed_by_id property.

    I'd recommend doing the following:

    1. Add fields for the owned_by_id and managed_by_id properties to the Form of the List ItemType
    2. Update the Permission of the List ItemType to give Edit permissions to the Owner and Manager identities
    3. Go to your "Available Design Materials" list item and set "Metal Work Management" as the owned_by_id
    4. Go to your "Design Shapes" list item and set "Design Department Administration" as the owned_by_id
    5. Confirm that the permissions work as expected

    This is a more flexible solution as it also ensures the same permissions are true even if the request comes from outside the client (maybe a future external app you use will have functionality to add values to Lists). More importantly, this also saves you the hassle of needing to write this functionality yourself. :)


    Christopher Gillis

    Aras Labs Software Engineer

  • Hey Chris,

    Thanks for the quick response. I completely forgot about the owner manager permissions as we hadn't utilized them before. I've made the change and it worked great. Thanks again.