[Product-Developers] SQLPASPlugin questions

11 Messages Forum Options Options
Permalink
j23d
[Product-Developers] SQLPASPlugin questions
Reply Threaded More
Print post
Permalink
hello,

I'm a developer with just a little experience in plone in the last few
weeks, just in case...

In a project I use the SQLPASPlugin for authentication what works out of
the box.
What I want to do is to hold the users and their roles in the PostgreSQL
database, but
the managers, reviewers, etc. in the ZODB. Is there an easy way to do
this or is there
another way to think about this?

And a more directly question: In an doctest I'd like to set the role to
manager
 >>> self.setRoles(('Manager',))
what fail, if I set up the the SQLPASPlugin with

Failed example:
    self.setRoles(('Manager',))
Exception raised:
    Traceback (most recent call last):
      File
"/opt/zope/instances/freitag.cms/eggs/zope.testing-3.0-py2.4.egg/zope/testing/doctest.py",
line 1348, in __run
        compileflags, 1) in test.globs
      File "<doctest test_article_workflow.rst[0]>", line 1, in ?
        self.setRoles(('Manager',))
      File
"/opt/zope/instances/freitag.cms/parts/plone/PloneTestCase/PloneTestCase.py",
line 110, in setRoles
        self.login(name)
      File
"/opt/zope/instances/freitag.cms/parts/zope2/lib/python/Testing/ZopeTestCase/PortalTestCase.py",
line 148, in login
        user = user.__of__(uf)
    AttributeError: 'NoneType' object has no attribute '__of__'

what is thrown imho because of the difference of the user objects.
Does anyone know how to deal with this?

best and thanks,
marco


_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
Michael Hierweck
Re: [Product-Developers] SQLPASPlugin questions
Reply Threaded More
Print post
Permalink
Marco Scheidhuber wrote:

> hello,
>
> I'm a developer with just a little experience in plone in the last few
> weeks, just in case...
>
> In a project I use the SQLPASPlugin for authentication what works out of
> the box.
> What I want to do is to hold the users and their roles in the PostgreSQL
> database, but
> the managers, reviewers, etc. in the ZODB. Is there an easy way to do
> this or is there
> another way to think about this?

This is possible because PAS is able to query many source for users,
roles and more.

_But_ SQLPAS lacks of support for searching for users...

Michael

_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
Tim Knapp
Re: [Product-Developers] SQLPASPlugin questions
Reply Threaded More
Print post
Permalink
Hi Michael,

On Wed, 2008-07-02 at 17:25 +0200, Michael Hierweck wrote:

> Marco Scheidhuber wrote:
> > hello,
> >
> > I'm a developer with just a little experience in plone in the last few
> > weeks, just in case...
> >
> > In a project I use the SQLPASPlugin for authentication what works out of
> > the box.
> > What I want to do is to hold the users and their roles in the PostgreSQL
> > database, but
> > the managers, reviewers, etc. in the ZODB. Is there an easy way to do
> > this or is there
> > another way to think about this?
>
> This is possible because PAS is able to query many source for users,
> roles and more.
>
> _But_ SQLPAS lacks of support for searching for users...

Yeah, I just realised this recently. Is a bit of a pain that there's no
mention of this on the product page on plone.org or in the README.txt
and nothing obvious in the tests either :(

I mean I know it can search on userids but the lack of support for
searching on user properties is a 'biggie' IMHO.

-Tim

>
> Michael
>
> _______________________________________________
> Product-Developers mailing list
> Product-Developers@...
> http://lists.plone.org/mailman/listinfo/product-developers


_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
Hedley Roos-2
Re: [Product-Developers] SQLPASPlugin questions
Reply Threaded More
Print post
Permalink
I'm sure we use a version that can indeed search. It is in our local
Upfront SVN repo. Will check tomorrow and post back.

_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
Tim Knapp
Re: [Product-Developers] SQLPASPlugin questions
Reply Threaded More
Print post
Permalink
On Wed, 2008-07-02 at 21:39 +0200, Hedley Roos wrote:
> I'm sure we use a version that can indeed search. It is in our local
> Upfront SVN repo. Will check tomorrow and post back.

Yes please!!!!

Thanks,
Tim

>
> _______________________________________________
> Product-Developers mailing list
> Product-Developers@...
> http://lists.plone.org/mailman/listinfo/product-developers


_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
j23d
Re: [Product-Developers] SQLPASPlugin questions
Reply Threaded More
Print post
Permalink
Marco Scheidhuber schrieb:
> And a more directly question: In an doctest I'd like to set the role
> to manager
> >>> self.setRoles(('Manager',))
> what fail, if I set up the the SQLPASPlugin
if somebody else stumble in this case:
the error was to set up the Plugin in afterSetUp, when the user
test_user_1 was already set.
with calling the function self._setup() from PortalTestCase the user
will be set again.

Marco


_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
Hedley Roos
Re: [Product-Developers] SQLPASPlugin questions
Reply Threaded More
Print post
Permalink
Tim Knapp wrote:
> On Wed, 2008-07-02 at 21:39 +0200, Hedley Roos wrote:
>> I'm sure we use a version that can indeed search. It is in our local
>> Upfront SVN repo. Will check tomorrow and post back.
>
> Yes please!!!!
>
> Thanks,
> Tim
>

Seems I was a bit hasty...

We do have a searchForMembers method which takes ZCatalog style
parameters, constructs an SQL query, and returns those members.
Unfortunately it is only designed to work for the prefs_users_overview
template. The normal searchForMembers that comes with PAS can query for
groups as well, so this one needs more work.

But it will work for prefs_users_overview if you tell the template to
use this searchForMembers.

H

_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
Tim Knapp
Re: [Product-Developers] SQLPASPlugin questions
Reply Threaded More
Print post
Permalink
Hello again Hedley,

On Thu, 2008-07-03 at 18:15 +0200, Hedley Roos wrote:

> Tim Knapp wrote:
> > On Wed, 2008-07-02 at 21:39 +0200, Hedley Roos wrote:
> >> I'm sure we use a version that can indeed search. It is in our local
> >> Upfront SVN repo. Will check tomorrow and post back.
> >
> > Yes please!!!!
> >
> > Thanks,
> > Tim
> >
>
> Seems I was a bit hasty...
>
> We do have a searchForMembers method which takes ZCatalog style
> parameters, constructs an SQL query, and returns those members.
> Unfortunately it is only designed to work for the prefs_users_overview
> template. The normal searchForMembers that comes with PAS can query for
> groups as well, so this one needs more work.
>
> But it will work for prefs_users_overview if you tell the template to
> use this searchForMembers.

I'd still be interested in seeing the code as it not only gives me a bit
of an example to start from but is also something my project could
benefit from. I'm also not too interested in groups anyway.

Thanks again,
Tim

>
> H
>
> _______________________________________________
> Product-Developers mailing list
> Product-Developers@...
> http://lists.plone.org/mailman/listinfo/product-developers


_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
Hedley Roos
Re: SQLPASPlugin questions
Reply Threaded More
Print post
Permalink

> I'd still be interested in seeing the code as it not only gives me a bit
> of an example to start from but is also something my project could
> benefit from. I'm also not too interested in groups anyway.

Here you go...

http://pastebin.org/49283

Roche Compaan wrote that method FYI.

Hedley


_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
Tim Knapp
Re: SQLPASPlugin questions
Reply Threaded More
Print post
Permalink
On Mon, 2008-07-07 at 11:56 +0200, Hedley Roos wrote:
> > I'd still be interested in seeing the code as it not only gives me a bit
> > of an example to start from but is also something my project could
> > benefit from. I'm also not too interested in groups anyway.
>
> Here you go...
>
> http://pastebin.org/49283
>
> Roche Compaan wrote that method FYI.

Thanks!

-Tim

>
> Hedley
>
>
> _______________________________________________
> Product-Developers mailing list
> Product-Developers@...
> http://lists.plone.org/mailman/listinfo/product-developers


_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers
Michael Hierweck
Re: SQLPASPlugin questions
Reply Threaded More
Print post
Permalink
Hedley Roos wrote:

>
>> I'd still be interested in seeing the code as it not only gives me a bit
>> of an example to start from but is also something my project could
>> benefit from. I'm also not too interested in groups anyway.
>
> Here you go...
>
> http://pastebin.org/49283
>
> Roche Compaan wrote that method FYI.

Great! Thank you. Is it possibile to get this improvement merged?

Michael

_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers