Am 09.01.2015 um 23:53 schrieb Petru Ciobanu:
To achieve this I was thinking to combine some predicates in this way:
|
Any(not_anonymous(),Not(not_anonymous()))
That gives a predicate that always returns True which is not really
useful ;-)
What you should do is open the controller for everybody (i.e. don't add
a @require decorator) and then check in the controller or in the view
whether the user is authenticated or not.
You could check this with a predicate, like this:
tg.predicates.not_anonymous().is_met(request.environ)
But in this case it's much easier to just check whether tg.identity is
set or not. You can either do this already in the controller method and
then pass only a limited amount of info if it's not set, or you can
check this in the view template and display a different amount of the
full info that has been passed by the controller.
It's really straightforward.
-- Chris
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.