Using DIF API to switch DFItem owner as admin

User 55ffa2f197

03-07-2015 13:46:12

Hi, Currently in IJC admin tool as  admin you can switch the owner of a DFItem say a view to yourself as the admin, then make change to it ... once the change is done switch the ownership back the orignal DFItem owner .... i suppose you can do that, i may be wrong


Is there a way you to do above through API, looking at DIFUtilities, and DFCapabilities, i could not find it.


We want to change some widgets in the forms thourgh API, to make change, i have to be the owner of the form, that's why we need this function.


Thanks


Dong

ChemAxon 37bb34e128

07-07-2015 07:05:06

Hi Dong,


yes you can do that using AdminTool and its 'Change Owner' functionality.


I am afraid that doing the same programmatically via DIF API is not possible by design. You can 'give' the ownership of an item that you own to someone else. This is possible to do using 'DFSharedObjectOwnerCapability' which is available on items that a user logged in to DIF/IJC owns. This capability is not available on items owned by someone else preventing users from 'stealing' the ownership.


AdminTool is quite different in the way how it access the IJC schema information. It does not use DIF at all and instead it uses a thin data access layer we call 'Schema Model' which interacts directly with the IJC schema information in the database. Hence it circumnavigates restrictions in DIF.


Thanks,
-vita

User 55ffa2f197

07-07-2015 11:33:40

Hi Vita,


Thanks for explaining how it works. It makes sense. It might be useful to give admin a true super user privilege through API so admin can alter useritems particularly the forms in case  there are changes in database schema, so admin can change useritems instead of having all users' making same changes.


Thanks


Dong

ChemAxon 37bb34e128

08-07-2015 07:53:50

Hi Dong,


I understand your usecase and agree that it would be useful to give an admin the privilege for editing someone else's items. It would be relatively easy to allow this, but the real problem is that the owner and the admin could then modify the item simultaneously and overwrite each other's changes. So far DIF is not good at detecting 'mid-air' conflicts and handling them in some meaningful way. That's why we use the concept of an exclusive ownership despite all its inconveniences.


Thanks,
-vita

User 55ffa2f197

08-07-2015 11:53:26

Hi Vita,


Great we are the same page. For such admin privilege we  will coordinate with other admin and users, when such preemptive modifications occur usually we would schedule an outage for the system to avoid conflict. It would be great to have such functions in API, and do at your own risk,  given the proliferation of the user forms, and growth of the system.


Thanks again


Dong

User 55ffa2f197

09-07-2015 13:38:44

Hi Vita,


Is it possible to offer a server patch for such super user capability through DIF? It becomes necessary as the proliferation of the user forms in our system, the amount manual work we need to do to make global change. I understand your concern on "mid-air" conflicts. We do not do such change often, as I said when we do such change, a server outage if posted, so no users might use IJC at the time change is being made.


What do you think?


Thanks


Dong