I want to be able to tell if a user can access a particular group using either LiQL or V1 api. Any idea how to do this?
Thanks
Solved! Go to Solution.
@Inactive User
You can do it in 2 different way
a) Get all groups of that specific user using below query
<#assign myGroups= rest("/groups/for/members/id/[user_id]").groups.group />
And search for that specific group if it exists.
b) Get all members of a group using the below query and check if that user exist in list
<#list restadmin("/groups/id/[group_id]/members?page_size=999").users.user as member>
<#if member.id?? && (member.id?number == user.id)>
<#assign show_module = true/>
<#break/>
</#if>
</#list>
I think option "a" will be better here.
Welcome to the Technology board!
Curious about our platform? Looking to connect on social technology? You've come to the right place!