Thanks for the reply,
Actually I just tried it with the identity-tutorial on the wiki ..
http://docs.turbogears.org/1.0/UsingIdentity and did exactly what its
said with a cut and paste of all the commands and entering the data
using the shell. The same error happens. This is the extra bits I
added to the controller

class Root(controllers.RootController):
    @expose(template="identity_tutorial.templates.welcome")
    @identity.require(identity.in_group("admin"))
..... [The standard root controller]

+

    @expose(template="identity_tutorial.templates.test")
    @identity.require(identity.in_group("admin"))
    def test(self):
        flash("test")
        users = User.select()
        return dict(users=users)

    @expose(template="identity_tutorial.templates.test")
    def open(self):
        flash("open : no access control")
        users = User.select()
        return dict(users=users)

So when I browse to localhost:8080 I am asked to log in and the
welcome page shows that I have logged in by displaying the username by
the code from the master template. when I go to test it asks me again
and if I go to open it displays fine but without the username being
displayed.

this is my tg-admin info output

tg-admin info
TurboGears Complete Version Information

TurboGears requires:

* turbogears 1.0.2.2
* celementtree 1.0.5-20051216
* configobj 4.4.0
* decoratortools 1.4
* ruledispatch 0.5a0.dev-r2306
* setuptools 0.6c5
* formencode 0.7.1
* pastescript 1.1
* elementtree 1.2.6
* simplejson 1.5
* cherrypy 2.2.1
* turbokid 1.0.1
* turbocheetah 0.9.5
* turbojson 1.0
* pyprotocols 1.0a0dev-r2302
* cheetah 1.0
* pastedeploy 0.5
* paste 0.9
* kid 0.9.5
* cheetah 1.0
* ruledispatch 0.5a0.dev-r2306
* decoratortools 1.4

Identity Providers

* sqlobject (turbogears 1.0.2.2)
* sqlalchemy (turbogears 1.0.2.2)

tg-admin Commands

* info (turbogears 1.0.2.2)
* shell (turbogears 1.0.2.2)
* quickstart (turbogears 1.0.2.2)
* update (turbogears 1.0.2.2)
* sql (turbogears 1.0.2.2)
* i18n (turbogears 1.0.2.2)
* toolbox (turbogears 1.0.2.2)

Visit Managers

* sqlobject (turbogears 1.0.2.2)
* sqlalchemy (turbogears 1.0.2.2)

Template Engines

* cheetah (turbocheetah 0.9.5)
* json (turbojson 1.0)
* kid (turbokid 1.0.1)

Widget Packages

* submodal (submodal 1.5)
* tinymce (turbotinymce 1.0.6)

Toolbox Plugins

* info (turbogears 1.0.2.2)
* catwalk (turbogears 1.0.2.2)
* shell (turbogears 1.0.2.2)
* designer (turbogears 1.0.2.2)
* widgets (turbogears 1.0.2.2)
* admi18n (turbogears 1.0.2.2)

TurboGears Extensions

* visit (turbogears 1.0.2.2)
* identity (turbogears 1.0.2.2)


On May 23, 3:53 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> If I understand right, then I did the same thing.  I quickstarted a
> project, but without Identity.  I added Identity in manually later (by
> copy & pasting from another project I quickstarted *with* Identity).
> Mine works fine.  Am I right in understanding what you did?
>
> Did you remember to import the identity module in your
> controllers.py...?
> e.g.: from turbogears import identity
>
> On May 23, 5:29 am, Diarmuid <[EMAIL PROTECTED]> wrote:
>
> > Guys,
>
> > IU have a TG project that I created using the command line (tg-admin)
> > but created the identity related stuff using the option within
> > quickstart, i.e not by including the -identity command line option .
>
> > I have added the created a user and a group and added
> > @identity.require(identity.in_group("admin")) to my class. When I go
> > to the page related to that class, the identity is displayed , based
> > on the default master template. The issue is that if I then want to go
> > to another page that is protected in the same way, the login page is
> > displayed again. It seems that the identity object is not being
> > retained between calls . I have tried enabling sessions but that did
> > not work.
>
> > I have read and ran the identity tutorial but that does not cover
> > multiple pages ( or if it does it assunes that all is fine). I feel I
> > am missing some simple step.
>
> > Cheers
>
> > Diarmuid


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to