Issue 27 in power-matchmaker: Logging into a PostgreSQL-based repository on a schema other than 'public' fails

4 views
Skip to first unread message

codesite...@google.com

unread,
Sep 9, 2009, 4:53:33 PM9/9/09
to dqguru...@googlegroups.com
Status: Accepted
Owner: ----
Labels: Type-Defect Priority-High Milestone-Release1.0 OpSys-All
DBMS-Postgresql Component-Persistence

New issue 27 by mo.jeff: Logging into a PostgreSQL-based repository on a
schema other than 'public' fails
http://code.google.com/p/power-matchmaker/issues/detail?id=27

What steps will reproduce the problem?
1. Create a new repository in a PostgreSQL (reproduced on 8.3 and 8.4)
database using the Connections->Create Repository... menu option. Make sure
you choose a schema other than the default 'public' schema.
2. Use the Connections->Connect to Remove Repository... menu option
3. Choose the database connection you used in Step 1.
4. Login fails with a PLSecurityException

What is the expected output? What do you see instead?
I expected to login successfully. Instead I get a security exception.

Is there an error stacktrace? If so, please paste it below.
ca.sqlpower.security.PLSecurityException: Denied permission.login because
security.credentials
at ca.sqlpower.security.PLUser.find(PLUser.java:472)
at ca.sqlpower.security.PLUser.findByPrimaryKeyDoNotUse(PLUser.java:328)
at ca.sqlpower.security.PLSecurityManager.<init>(PLSecurityManager.java:90)
at
ca.sqlpower.matchmaker.dao.hibernate.MatchMakerHibernateSessionImpl.<init>(MatchMakerHibernateSessionImpl.java:235)
at
ca.sqlpower.matchmaker.dao.hibernate.MatchMakerHibernateSessionContext.createSession(MatchMakerHibernateSessionContext.java:147)
at
ca.sqlpower.matchmaker.swingui.SwingSessionContextImpl.createSession(SwingSessionContextImpl.java:227)
at
ca.sqlpower.matchmaker.swingui.LoginDialog$LoginAction.doStuff(LoginDialog.java:147)
at ca.sqlpower.swingui.SPSwingWorker.run(SPSwingWorker.java:104)
at java.lang.Thread.run(Thread.java:595)
Please use labels and text to provide additional information.

Further comments:
The problem is rooted in the PLUser class. It's find() method does not use
a fully qualified name to look up the PL_USER table. As a result, it will
use the default schema in PostgreSQL (and presumably in other platforms as
well), which is 'public'. But if the repository was created in another
schema, then it will be looking for the PL_USER table in the wrong place.
In most cases, it would fail with this error, but it could also be looking
up a PL_USER table in public if one exists, thus getting the wrong
information back.


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

Reply all
Reply to author
Forward
0 new messages