[Grok-dev] Re: Protecting views to allow anonymous access only

Andreas Kaiser kaiser at xo7.de
Thu Jul 31 06:31:23 EDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dennis Noordsij schrieb:
| Philipp von Weitershausen schreef:
|> Andreas Kaiser wrote:
|>> I'm in the progress of developing my first Grok application, so please
|>> be patient with me and my maybe stupid questions.
|>>
|>> Right now I'm stuck with this…
|>>
|>> I need to protect a view, so that it can be accessed *only* by
|>> anonymous users.
|> That's going to be hard to impossible to do with Zope's default
security
|> policy.
|
| You could do the following:
|
| In buildout.cfg,
|
| <unauthenticatedPrincipal id="zope.anybody"
|           title="Anonymous user" />
|
| <grant permission="mysite.Anonymous" principal="zope.anybody" />
|
| Then you can protect a view with mysite.Anonymous and only not-logged-in
| users can access it.
|
| (I use it to add a "login", "register", etc viewlet to the default
layout).
|
| Or am I missing the problem?

No, this is *exactly* what I want to achieve.

Thanks everyone for your suggestions, I'll try them ASAP.


Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIkZR6/IUfrcGW134RAonyAJ4rZPO5MTe6cLi+BJnuIG/WYCRtiwCeMR0S
2cZVOyo2aSYDTaX4NMKGPTA=
=Qvsb
-----END PGP SIGNATURE-----


More information about the Grok-dev mailing list