-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a script that saves data owner as key-value pair #206
base: develop
Are you sure you want to change the base?
Conversation
In the end, it could be nice to integrate this script directly during the ownership changing process (i.e. when clicking on "change ownership") rather than running the script first to add the owner as KVP and then changing the ownership. |
Hey @Rdornier! Thanks for this, and very sorry for having missed it originally. We're now in a bit of a summer gap, but we'll get this in front of some folks for a review ASAP. |
Hi @Rdornier - Apologies for not looking at this sooner... The script works well, ran as a regular user... Then I logged-in as an Admin, and changed the owner of an Image to another member of the group (Admin wasn't a member of this group) and I tried running the script again as an Admin. This attempted to remove the previous annotation, which failed (see error below), so the annotations didn't get updated at-all. Stack trace
If I commented-out the I don't know how the permissions will work in your typical use case, but at the very least you should |
Hello @will-moore Thanks for having a look to my code and to figure this issue. Anyway, I pushed some modifications and key-values are not deleted anymore. I only add them in the namespace. So this issue should be corrected now.
Yes, I did it only on
Done
This is corrected now. I only link the |
Hello,
As suggested, here is a python script implementing ownership tracability as a key-value pair.
The script accepts as input arguments either image ids, container ids (dataset, project, well, plate, screen) or usernames.
For images and containers, their ID is required and the script adds the owner-keyVal to the specified images/containers and all their children.
For users, their omero-username is required and the script adds the owner-keyVal to all data owned by the users, in all groups they are member of.
If the logged-in user is admin, a sudo connection is established.
I created an excel sheet where I consigned the results of different tests I have done but, as you'll see, there is a scenario I do not really understand.
I thought it was possible to add the key-value on data owned by someone in a private group with a sudo connection but, apparently, it is not the case.
Happy to answer any questions and to improve the script.
Thanks and all the best,
Rémy.