Ksenia Marasanova <[EMAIL PROTECTED]> writes:
> Just a thought - maybe it's worth to extend require function with an
> extra parameter for sqlbuilder expression?
> e.g.
> @identity.require(query=OR(User.q.group == groupA, User.q.group == groupB))
To use this we'd be force to:
1. from turbogears.identity.model.somodel import User
or
2. from sqlobject.sqlbuilder import OR
(...)
@identity.require(query=OR(identity.model.somodel.User.q.group ==
groupA,
identity.model.somodel.User.q.group ==
groupB))
I'd rather have this more transparent as it is now. Maybe being able to
specify multiple values for "group" would do it:
@identity.require(group=["groupA", "groupB"])
Then, if any of these is True, grant access, otherwise deny it. The old
syntax for an "AND" could still be used:
@identity.require(group=["groupA", "groupB, groupC"])
Here, either the user is in groupA or he's simultaneously in groupB and
groupC.
I believe the changes to the filter used wouldn't be too big this way.
--
Jorge Godoy <[EMAIL PROTECTED]>