* Diez B. Roggisch <[email protected]> wrote on [05-06-10y 13:35]:
>
> Am 06.05.2010 um 21:39 schrieb Ryan:
>
> >* Diez B. Roggisch <[email protected]> wrote on [05-06-10y 12:25]:
> >>
> >>Am 06.05.2010 um 21:05 schrieb Ryan:
> >>
> >>>When I connect to admin I get a flash message:
> >>> Current user must belong to the group "managers"
> >>>
> >>>I see in the docs, you can override AdminController with:
> >>>
> >>>class myAdminController(AdminController):
> >>> allow_only = has_permission('manage')
> >>>
> >>>But I cannot find in the docs what strings has_permission
> >>>takes. What
> >>>can I put there for: has_permission('all')
> Ah. Hm. What about
>
> allow_only = Any(not_anonymous(), is_anonymous())
>
> where Any and *_anonymous are repoze.what predicates of course.
>
> That should give you an always-true predicate.
>
> Diez
Hey Diez! That did it, Thanks! For completeness, here I include all the
code I needed to make it work:
....
from repoze.what.predicates import Any, is_anonymous, not_anonymous
class RootController(BaseController):
"""
The root controller for the this application......
"""
class myAdminController(AdminController):
allow_only = Any(not_anonymous(), is_anonymous())
admin = myAdminController(model, DBSession)
....
Now, to figure out what is wrong with my model.....
--
+-----------------------------+
| [email protected] |
| http://www.the-summit.net |
+-----------------------------+
--
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.