Well, you can give group membership to guest user:
auth.add_membership(group_id, None)
Now accessible_query works fine and it does not evaluate to false :-P
But still it makes no sense because Auth is not made to work for guest
users, e.g. auth.has_permission will not work.
It adds a little ambiguity to auth, but it's not a big issue.
Another solution is to keep an exception, but make it more descriptive, and
force developers to check if user is logged in before accessible_query is
called.
It worked that way until now, and no one complained :-)
It's up to you, i'm fine with both solutions.


Marin


On Wed, Aug 17, 2011 at 11:25 PM, Massimo Di Pierro <
[email protected]> wrote:

> It is not intentional and I think I have a workaround in trunk (please
> check it). yet it makes no sense to get an accessible_query if user is
> not logged it. It would just generate a query that always evaluates to
> false.
>
> On Aug 17, 3:48 pm, Marin Pranjic <[email protected]> wrote:
> > Repeating the question :)
> >
> >
> >
> >
> >
> >
> >
> > On Tue, Aug 16, 2011 at 10:21 AM, Marin <[email protected]> wrote:
> > > Also, I noticed that accessible_query raises an exception if user is
> > > not logged in.
> > > It's because of a line 2805 (trunk) in gluon/tools.py:
> > > user_id = self.user.id
> >
> > > What is expected behavior if user is not logged in? Is this
> > > intentional?
>

Reply via email to