Public
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Not applicable

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?

Thanks

1 Reply 1
Boss

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

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

Welcome to the Technology board!

Curious about our platform? Looking to connect on social technology? You've come to the right place!

Are you a Khoros customer? For direct assistance from our Support team, please visit the Support Forum.