I wish to retrieve the list of all users that belong to a particular role.
The query is to know:
- if there's any drupal method that provides list of all available roles created under Admin >> User Management (admin/user/roles) similar to retrieving all node types using node_get_types method.
- if there's a drupal method to get list of all users who belong to a particular role.
Though I could get this done by querying the
role table and using the result with
user_roles table, I felt that there might be some in-built method in drupal which must enable me to achieve the desired result which i might've missed out searching.
I'm aware that it's not ideal to check user permission related stuff with roles and rather user permissions instead from this post.
It'd be great if I could get a definite answer for my above mentioned queries.