I would maybe add a relation writeable_contracts to the group entity (-
> join conditions in sqlalchemy).
One you have that, you should be able to achieve a predicate, which
you can register

def group_can_write_contracts(policy, obj, action,  attr, user):
    contract=obj
    for group in user.groups:
       if contract in group.writeable_contracts:
            return True
    return Denial("Only members of ... groups can write this
contract")
YourPolicy.register(group_can_write_contracts, obj=Contract,
action=...,...)

Michael

--~--~---------~--~----~------------~-------~--~----~
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