KonaKart Community Forum

Installation / Configuration => Configuration of KonaKart => Topic started by: michaelwechner on February 10, 2011, 03:42:11 pm

Title: Multistore user with access to all stores, but limited functionality
Post by: michaelwechner on February 10, 2011, 03:42:11 pm
Hi

One can assign a superuser role such that one can access with the same user all stores and
which then can do everything, e.g. the user admin@konakart.com

We would like to create a user which also has access to all stores, but can only manipulate
the orders and not the customers.

Is this possible somehow?

Thanks

Michael
Title: Re: Multistore user with access to all stores, but limited functionality
Post by: ming on February 12, 2011, 08:53:16 am
Yes you can define and then assign roles that will allow you to do that.
After a normal installation you will see example users which should give you a good idea about how to do this.

Basically you will need shared customers and for the admin user in question you should not enable the customer panel.
Title: Re: Multistore user with access to all stores, but limited functionality
Post by: michaelwechner on February 14, 2011, 09:04:39 pm
Hi ming

Thanks very much for these hints. The problem is that when we apply the same roles to the same user within two or more stores, the we receive the following error:

(org.apache.torque.TorqueException) - org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "kk_customers_to_role_pkey"

Exception Stack Trace =
at org.apache.torque.util.BasePeer.throwTorqueException(BasePeer.java:109)
at org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:688)
at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:554)
at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:431)
at com.konakartadmin.bl.AdminSecurityMgr.addRolesToUser(Unknown Source)
at com.konakartadmin.bl.KKAdmin.addRolesToUser(Unknown Source)
at com.konakartadmin.server.KKAdminGWTServiceImpl.addRolesToUser(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:188)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:224)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)

Exception Cause =
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1548)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1316)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:191)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:351)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:305)
at com.workingdogs.village.Record.saveWithInsert(Record.java:438)
at com.workingdogs.village.Record.save(Record.java:234)
at com.workingdogs.village.Record.save(Record.java:201)
at org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:685)
at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:554)
at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:431)
at com.konakartadmin.bl.AdminSecurityMgr.addRolesToUser(Unknown Source)
at com.konakartadmin.bl.KKAdmin.addRolesToUser(Unknown Source)
at com.konakartadmin.server.KKAdminGWTServiceImpl.addRolesToUser(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:188)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:224)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)

Any idea what might be wrong?

Thanks

Michael
Title: Re: Multistore user with access to all stores, but limited functionality
Post by: ming on February 28, 2011, 05:22:46 pm
I can't see a way of reproducing this problem if you set up the roles using the Admin App.

How did you set them up in your case?   Did you use SQL directly?
Title: Re: Multistore user with access to all stores, but limited functionality
Post by: michaelwechner on February 28, 2011, 05:27:14 pm
Hi ming

We setup the stores and the roles through web based Admin App.

We did not touch the SQL directly.

Thanks for your help on this

Michael
Title: Re: Multistore user with access to all stores, but limited functionality
Post by: ming on February 28, 2011, 05:32:32 pm
If you can document the steps you took, describing precisely your engine mode, version etc and how you installed the Enterprise Extensions it would help.