Khoros Atlas Logo

Respected Contributor
Respected Contributor

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

Jump to solution

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

0 Kudos
1 Reply 1
Honored Contributor
Honored Contributor

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

Jump to solution

@IanAtJMP 
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. 

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