Is there really no standard way to retrieve a user list, based on role? This page seems to suggest this and I can't find anything to the contrary in the api.

I'm finding myself building lists of users by querying the database directly, which makes me feel dirty. I'd much rather use a function.

Is there something I've missed?

Comments

richard.e.morton’s picture

I would like users of my site to be able to locate users by role without having the permission to administer users - obviously. The website www.plusgroups.org.uk, is for a national multi activity club in the UK which has volunteers running events and clubs around the uk, as such people move roles and so a role based search is desperately needed. I have requested this of the Advanced User module and it may be incorporated but a simpler lighter-weight module would be nice.

Anyone know of a way to do this.

Thanks

Richard

kingandy’s picture

From a user point of view there's http://drupal.org/project/site_user_list which I think may be poked and prodded to support roles (in fact it comes packaged with a site_user_list_roles add-on module).

I'm really more interested in how to gather such data from a development point of view, at the moment (AFAIK) if a module developer wants to present such a list they have to go deep down into the database. It would be nice to have a function that you could just give a role ID and get back a collection of user objects. Site_user_list_roles is actually one of the modules that would have benefited from such functionality...

--Andy
Developing Drupal websites for Livelink New Media

++Andy