Page 1 of 1

how to "Connect to my buddy’s data"

PostPosted: Mon Apr 29, 2013 12:13 pm
by yuriy_alexandrov
Hi All,

Our FLIMfit program is Matalb-based OMERO client currently working with data in the User scope.

I wonder if there is possibility to “load and annotate” the data of any other User form any of the groups to which current User belongs?
Other words, to have “Connect to my buddy’s data” option.

As it looks from some of the examples posted previously - that needs Administrator logon and then changing “security contexts”.

How practical is that, what are the steps, possible examples, and also if maybe there are some shortcuts?

Many thanks,
Y.

Re: how to "Connect to my buddy’s data"

PostPosted: Tue Apr 30, 2013 8:35 pm
by sbesson
Hi Yuriy

Reading and annotating objects from other users's in my group may not require you to be administrator, e.g. in a read-annotate group (see the permissions tables).

Can you give me a more concrete example of what you are trying to achieve? Are you trying to load images only or projects/datasets/screens/plates as well?

Sebastien

Re: how to "Connect to my buddy’s data"

PostPosted: Wed May 01, 2013 10:31 am
by yuriy_alexandrov
Thanks Sebastien,

In the highest Omero scope, we keep client, session and "working data", - that might be Dataset or Plate, and its parent data for convenience - Project or Screen.

We load images for analysis from that Dataset or Plate.

Everything is chosen from the data of the current user - here is excerpt from "select_Dataset" function:

Code: Select all
            param = omero.sys.ParametersI();
            param.leaves();
            %           
            userId = session.getAdminService().getEventContext().userId;
            param.exp(omero.rtypes.rlong(userId));
            projectsList = proxy.loadContainerHierarchy('omero.model.Project', [], param);
            alldatasetsList = proxy.loadContainerHierarchy('omero.model.Dataset', [], param);
            %etc..

Annotations might be imported/exported to/from Datasets or Plates of that current user, too.

What I would like to do - ideally is to somehow "switch logon" to another user without knowing password, to work with his/her data instead.

I can guess that the "session" should be switched, or maybe one can solve it by adding the set of corresponding objects for "another_user"?
...

Re: how to "Connect to my buddy’s data"

PostPosted: Wed May 01, 2013 9:48 pm
by sbesson
Hi Yuriy,

barring any permission issue (private group), you should be able to access other user's data within the context of the original session using the experimenter parameters:

Code: Select all
param = omero.sys.ParametersI();
param.leaves();

userId = session.getAdminService().getEventContext().userId;
param.exp(omero.rtypes.rlong(userId));
myProjectsList = proxy.loadContainerHierarchy('omero.model.Project', [], param);

param.exp(omero.rtypes.rlong(otherId));
otherProjectsList = proxy.loadContainerHierarchy('omero.model.Project', [], param);


You can also load all projects of all users for the current group by passing -1:

Code: Select all
param = omero.sys.ParametersI();
param.leaves();
           
param.exp(omero.rtypes.rlong(-1));
allProjectsList = proxy.loadContainerHierarchy('omero.model.Project', [], param);


If using OMERO.matlab 4.4.7 or greater, you can set this using the owner parameter/value pair:

Code: Select all
myProjects = getProjects(session);
otherProjects = getProjects(session, 'owner', otherId);
allProjects  = getProjects(session, 'owner', -1);


Note the all the examples above only return objects within the context of the current session group. To retrieve projects from another group, you need to switch the session context:

Code: Select all
session.setSecurityContext(newgroup);

Re: how to "Connect to my buddy’s data"

PostPosted: Fri May 03, 2013 12:59 pm
by yuriy_alexandrov
Many thanks Sebastien, looks very helpful.. will try to use it soon..

Best regards,
Y.