Showing results for 
Show  only  | Search instead for 
Did you mean: 
Esteemed Contributor

Determine user's access to a particular group using LiQL or V1

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?


1 Reply 1
Honored Contributor

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]") />
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 && ( ==>
<#assign show_module = true/>

I think option "a" will be better here. 

Give kudos if you find my posts helpful or mark solution if it answers your query