[Grok-dev] users / authentication / permissions

Tim Terlegard tim.terlegard at lovelysystems.com
Fri May 11 09:37:57 EDT 2007


> with Zope 2 it's pretty easy to create users and set permissions? But
> how to do this in Grok? Let's say I want to write some wiki or blog
> service, where users can create an account and edit their personal
> pages, that only the user itself can edit, but are viewable by
> everybody. What's the right way to do it?

NudgeNudge gives you an example how to do it. Look in
http://codespeak.net/svn/z3/NudgeNudge/trunk/src/nudgenudge/app.py

To define a permission:

grok.define_permission('nudge.AddReview')


To only allow certain people to use a view:

class CreateReview(grok.AddForm):
    grok.require('nudge.AddReview')

Tim


More information about the Grok-dev mailing list