pyramid_formalchemy with object ACL

48 views
Skip to first unread message

Mat

unread,
Jun 22, 2012, 4:29:36 PM6/22/12
to forma...@googlegroups.com
Hello,
I am having trouble using pyramid_formalchemy with my default RootFactory because I am using object ACL.

I get the following error:
  File "/home/mat/myproject/lib/python2.6/site-packages/pyramid-1.3-py2.6.egg/pyramid/authorization.py", line 84, in permits
    for ace in acl:
TypeError: 'property' object is not iterable


I defined my RootFactory this way:

from pyramid_formalchemy.resources import Models
class RootFactory(Models):
    __acl__ = [
        (Allow, 'g:admins', ALL_PERMISSIONS),
        (Allow, 'g:verified', ('registered', 'verified')),]

And each models look like this:
class User(Base):
    @property
    def __acl__(self):
        return [
            (Allow, self.id, 'edit'),
            (Deny, Everyone, 'edit'),
        ]

Any help you be appreciated! :)

regards,
Mat

Reply all
Reply to author
Forward
0 new messages