Thanks Johann

Had to modify to also add (db.auth_group.id==db.auth_membership.group_id)

db((db.auth_user.id==db.auth_membership.user_id)&(db.auth_group.id==db.auth_permission.group_id)&(db.auth_permission.name=='load')).select(db.auth_user.id, distinct=True)

Thanks again for getting me down the right path.

    -Jim

On 4/20/2012 8:54 AM, Johann Spies wrote:
On 20 April 2012 15:37, Jim Steil <[email protected] <mailto:[email protected]>> wrote:

    That's not quite it either.  This is checking for a group 'role'
    as opposed to looking for all users that have a specific
    permission (auth_permission).


Then adapt it. Determine the group name that have the specific permission and from there it is easy to determine the id's of the members of that group. Something like

reds = [x.id <http://x.id/> for x in db((db.auth_user.id <http://db.auth_user.id/> == db.auth_membership.user_id)&(db.auth_group.id <http://db.auth_group.id/> == db.auth_permission.group_id) & (db.auth.permission.name <http://db.auth.permission.name> == 'kb_ed')).select(db.auth_user.id <http://db.auth_user.id/>)]

Regards
Johann
--
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

Reply via email to