either you add redundantly groups or you have to resort to a recursive 
query each time you need to check for membership at higher levels than the 
first one... in either case I really don't see the issue: given that 
auth_membership is a one-to-many, web2py isn't getting in your way.

If you don't want to go for the multiple membership way, you can code 
easily a function that given the lowest membership checks recursively for 
higher levels in your own 
city-->state-->country-->world-->galaxy-->universe-->whatever map.

On Monday, June 29, 2015 at 9:56:20 PM UTC+2, Alex Glaros wrote:
>
> Example: Role is "Citizen" (In db.auth_group)
>
> Object (as in Subject/Predicate/Object) of role is "City of New Orleans" 
> (Added extra field in db.auth_group "superObject" for this object role.)
>
> In db.auth_membership, user_id is "Bob" with FK to db.auth_group.role. 
> Result: "Bob is citizen of New Orleans."
>
> So far so good, all New Orleans citizens are handled by being added to 
> db.auth_membership
>
> But Bob is also a citizen of Louisiana. And also a citizen of U.S.
>
> How to have Louisiana and U.S. automatically inherit attributes so that 
> system knows Bob is also citizen at state and federal level?
>
> Goal is to have function in controller able to answer question "Is Bob a 
> US citizen?" without having to redundantly place Bob in additional role 
> groups (db.auth_group: state citizen role, db.auth_group: federal citizen 
> role).
>
> thanks,
>
> Alex Glaros
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to