FYI, 'bhcho' is an admin account.
- Code: Select all
In [19]: client = omero.client('ourhost')
In [20]: session = client.createSession(ID, PW)
In [21]: principal = omero.sys.Principal()
In [22]: session.getAdminService().getEventContext()
Out[22]:
object #0 (::omero::sys::EventContext)
{
shareId = -1
sessionId = 67434
sessionUuid = 48e2c655-fcfe-43f7-8c6a-b8f0a6a8d8aa
userId = 2
userName = bhcho
groupId = 3
groupName = Researchers
isAdmin = True
eventId = -1
eventType = User
memberOfGroups =
{
[0] = 1
[1] = 3
[2] = 0
}
leaderOfGroups =
{
}
groupPermissions = object #1 (::omero::model::Permissions)
{
_perm1 = -39
}
}
In [23]: gateway=session.createGateway()
In [24]: image=gateway.getImage(long(551))
In [25]: image.getDetails().getGroup().getName()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/OMERO_DIST/<ipython console> in <module>()
AttributeError: 'NoneType' object has no attribute 'getDetails'
it seems like even the admin account cannot retrieve an image (which is owned by a general account 'demo_ome')
After I merge,
- Code: Select all
In [21]: principal = omero.sys.Principal()
In [22]: principal.name = 'demo_ome'
In [23]: principal.group = 'Researchers'
In [24]: principal.eventType = "User"
In [25]: timeout = 600000 # 60*2 seconds (milliseconds)
In [26]: user_session = session.getSessionService().createSessionWithTimeout(principal, timeout)
In [27]: client.closeSession()
In [28]: session = client.joinSession(user_session.uuid.val)
In [29]: session.getAdminService().getEventContext()
Out[29]:
object #0 (::omero::sys::EventContext)
{
shareId = -1
sessionId = 67436
sessionUuid = a37f8c07-9490-440a-998c-9930abbd0ab4
userId = 352
userName = demo_ome
groupId = 3
groupName = Researchers
isAdmin = False
eventId = -1
eventType = User
memberOfGroups =
{
[0] = 3
[1] = 1
}
leaderOfGroups =
{
}
groupPermissions = object #1 (::omero::model::Permissions)
{
_perm1 = -39
}
}
In [30]:
In [31]: gateway=session.createGateway()
In [32]: image=gateway.getImage(long(551))
In [33]: image.getDetails().getGroup().getName()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/OMERO_DIST/<ipython console> in <module>()
AttributeError: 'NoneType' object has no attribute 'getDetails'
I still have the same error
BK