Failed
OmeroPy.test.integration.gatewaytest.test_chmod.TestDefaultSetup.testAuthorCanEdit (from pytest)
Error Message
omero.SecurityViolation: exception ::omero::SecurityViolation { serverStackTrace = ome.conditions.SecurityViolation: Bad authentication credentials for this action. See setSecurityPassword for more information at ome.security.basic.BasicMethodSecurity.checkMethod(BasicMethodSecurity.java:125) at ome.security.basic.BasicSecurityWiring.invoke(BasicSecurityWiring.java:76) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at ome.services.blitz.fire.AopContextInitializer.invoke(AopContextInitializer.java:43) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) at com.sun.proxy.$Proxy91.changeUserPassword(Unknown Source) at jdk.internal.reflect.GeneratedMethodAccessor3869.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at ome.services.blitz.util.IceMethodInvoker.invoke(IceMethodInvoker.java:172) at ome.services.throttling.Callback.run(Callback.java:56) at ome.services.throttling.InThreadThrottlingStrategy.callInvokerOnRawArgs(InThreadThrottlingStrategy.java:56) at ome.services.blitz.impl.AbstractAmdServant.callInvokerOnRawArgs(AbstractAmdServant.java:140) at ome.services.blitz.impl.AdminI.changeUserPassword_async(AdminI.java:159) at jdk.internal.reflect.GeneratedMethodAccessor3868.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at omero.cmd.CallContext.invoke(CallContext.java:85) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) at com.sun.proxy.$Proxy92.changeUserPassword_async(Unknown Source) at omero.api._IAdminTie.changeUserPassword_async(_IAdminTie.java:126) at omero.api._IAdminDisp.___changeUserPassword(_IAdminDisp.java:2003) at omero.api._IAdminDisp.__dispatch(_IAdminDisp.java:2237) at IceInternal.Incoming.invoke(Incoming.java:221) at Ice.ConnectionI.invokeAll(ConnectionI.java:2536) at Ice.ConnectionI.dispatch(ConnectionI.java:1145) at Ice.ConnectionI.message(ConnectionI.java:1056) at IceInternal.ThreadPool.run(ThreadPool.java:395) at IceInternal.ThreadPool.access$300(ThreadPool.java:12) at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:832) at java.base/java.lang.Thread.run(Thread.java:829) serverExceptionClass = ome.conditions.SecurityViolation message = Bad authentication credentials for this action. See setSecurityPassword for more information }
Stacktrace
self = <test.integration.gatewaytest.test_chmod.TestDefaultSetup object at 0x7f6e86981730> gatewaywrapper = <omero.gateway.pytest_fixtures.GatewayWrapper object at 0x7f6e439b1280> author_testimg_generated = <_ImageWrapper id=5698> def testAuthorCanEdit(self, gatewaywrapper, author_testimg_generated): """ Tests whether the default Users created by default setUp() canEdit their Images etc. """ image = author_testimg_generated imageId = image.id gatewaywrapper.gateway.getAdminService().getEventContext() group = gatewaywrapper.gateway.getGroupFromContext() image_gid = image.getDetails().getGroup().id image.getDetails().getGroup().name # Author should be able to Edit and Annotate their own data assert image.canEdit(), "Author can edit their own image" assert image.canAnnotate(), "Author can annotate their own image" # Login as Admin gatewaywrapper.loginAsAdmin() gatewaywrapper.gateway.SERVICE_OPTS.setOmeroGroup('-1') i = gatewaywrapper.gateway.getObject("Image", imageId) assert i.canEdit(), "Admin can edit Author's image" assert i.canAnnotate(), "Admin can annotate Author's image" # Login as default "User" # NB: seems this user is not in same group as Author's image. gatewaywrapper.loginAsUser() gatewaywrapper.gateway.SERVICE_OPTS.setOmeroGroup('-1') i = gatewaywrapper.gateway.getObject("Image", imageId) assert i is None, \ "User cannot access Author's image in Read-only group" # Create new user in the same group gatewaywrapper.loginAsAdmin() # groupname = image_gname chmod_test_user = dbhelpers.UserEntry( 'chmod_test_user6', 'foobar', firstname='User', lastname='Chmod') > chmod_test_user.create(gatewaywrapper.gateway, dbhelpers.ROOT.passwd) test/integration/gatewaytest/test_chmod.py:510: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../../../.venv3/lib64/python3.9/site-packages/omero/gateway/scripts/dbhelpers.py:205: in create a.changeUserPassword( ../../../../.venv3/lib64/python3.9/site-packages/omero/gateway/__init__.py:4844: in __call__ return self.handle_exception(e, *args, **kwargs) ../../../../.venv3/lib64/python3.9/site-packages/omero/gateway/__init__.py:4841: in __call__ return self.f(*args, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = 76c4fec6-5ab8-4c96-9956-91839207f5e9/5076d060-0162-4f81-93ac-ed1d9242d83aomero.api.IAdmin -t -e 1.1:tcp -h 172.18.0.9 -p 37587 -t 60000 omeName = 'chmod_test_user6' newPassword = object #0 (::omero::RString) { _val = foobar }, _ctx = None def changeUserPassword(self, omeName, newPassword, _ctx=None): > return _M_omero.api.IAdmin._op_changeUserPassword.invoke(self, ((omeName, newPassword), _ctx)) E omero.SecurityViolation: exception ::omero::SecurityViolation E { E serverStackTrace = ome.conditions.SecurityViolation: Bad authentication credentials for this action. E See setSecurityPassword for more information E at ome.security.basic.BasicMethodSecurity.checkMethod(BasicMethodSecurity.java:125) E at ome.security.basic.BasicSecurityWiring.invoke(BasicSecurityWiring.java:76) E at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) E at ome.services.blitz.fire.AopContextInitializer.invoke(AopContextInitializer.java:43) E at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) E at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) E at com.sun.proxy.$Proxy91.changeUserPassword(Unknown Source) E at jdk.internal.reflect.GeneratedMethodAccessor3869.invoke(Unknown Source) E at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) E at java.base/java.lang.reflect.Method.invoke(Method.java:566) E at ome.services.blitz.util.IceMethodInvoker.invoke(IceMethodInvoker.java:172) E at ome.services.throttling.Callback.run(Callback.java:56) E at ome.services.throttling.InThreadThrottlingStrategy.callInvokerOnRawArgs(InThreadThrottlingStrategy.java:56) E at ome.services.blitz.impl.AbstractAmdServant.callInvokerOnRawArgs(AbstractAmdServant.java:140) E at ome.services.blitz.impl.AdminI.changeUserPassword_async(AdminI.java:159) E at jdk.internal.reflect.GeneratedMethodAccessor3868.invoke(Unknown Source) E at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) E at java.base/java.lang.reflect.Method.invoke(Method.java:566) E at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) E at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) E at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) E at omero.cmd.CallContext.invoke(CallContext.java:85) E at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) E at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) E at com.sun.proxy.$Proxy92.changeUserPassword_async(Unknown Source) E at omero.api._IAdminTie.changeUserPassword_async(_IAdminTie.java:126) E at omero.api._IAdminDisp.___changeUserPassword(_IAdminDisp.java:2003) E at omero.api._IAdminDisp.__dispatch(_IAdminDisp.java:2237) E at IceInternal.Incoming.invoke(Incoming.java:221) E at Ice.ConnectionI.invokeAll(ConnectionI.java:2536) E at Ice.ConnectionI.dispatch(ConnectionI.java:1145) E at Ice.ConnectionI.message(ConnectionI.java:1056) E at IceInternal.ThreadPool.run(ThreadPool.java:395) E at IceInternal.ThreadPool.access$300(ThreadPool.java:12) E at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:832) E at java.base/java.lang.Thread.run(Thread.java:829) E E serverExceptionClass = ome.conditions.SecurityViolation E message = Bad authentication credentials for this action. E See setSecurityPassword for more information E } ../../../../.venv3/lib64/python3.9/site-packages/omero_api_IAdmin_ice.py:2499: SecurityViolation