Skip to content

Instantly share code, notes, and snippets.

@atarkowska
Last active June 26, 2016 07:30
Show Gist options
  • Save atarkowska/07c7ebcf9ed564623605dd4ca6cdb56a to your computer and use it in GitHub Desktop.
Save atarkowska/07c7ebcf9ed564623605dd4ca6cdb56a to your computer and use it in GitHub Desktop.
import omero, os
host = "localhost"
port = 4064
user = "user-1"
password = "ome"
c = omero.client(host=host, port=port)
s = c.createSession(user, password)
share_service = s.getShareService()
public_user = s.getAdminService().lookupExperimenter('public')
gid = s.getAdminService().getEventContext().groupId
group = s.getAdminService().getGroup(gid)
sid = share_service.createShare("this is test for rwrar- group shared with public user", None, [group], [public_user], [], True)
print 'Share ID:', sid
s.closeOnDestroy()
c.closeSession()
c.__del__()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment