Thank you for your kind words.
There is currently no public API functionality like that, but it does make sense to provide it.
Can I ask you what your use case is?
Thanks for the answer Joachim.
Pitifully, it’s indispensable to show separate content for different groups in my site. So, if there’s no API to do it, I must use another plugin.
The use case is the mentioned one: I need to show one content to users belonging to one group and another content to users belonging to a different group in the same publication. For economy, the idea is to do it in just one post and to integrate the selection of content according to group membership in the template.
Do you need functions that you can use in your theme templates, or would it work if you used the [restrict] shortcode in a post/page?
Right now that shortcode only works for roles, but I will make it work with levels too soon. Maybe I can start on an API that you can use in theme templates as well.
FWIW I also need a very simple way in PHP to determine if I should show some page functionality based on the user’s role. I can’t use a shortcode for this– it’s part of my PHP template code.
The plugin comes with a lightweight API. While there is no function to check if a user has a role, it should be easy to determine with this function:
rua_get_user_roles($user_id:int):array
Let me know if that works.