Khoros Atlas Logo

%3CLINGO-SUB%20id%3D%22lingo-sub-551993%22%20slang%3D%22en-US%22%3EDetermine%20user's%20access%20to%20a%20particular%20group%20using%20LiQL%20or%20V1%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-551993%22%20slang%3D%22en-US%22%3E%3CP%3EI%20want%20to%20be%20able%20to%20tell%20if%20a%20user%20can%20access%20a%20particular%20group%20using%20either%20LiQL%20or%20V1%20api.%20Any%20idea%20how%20to%20do%20this%3F%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-552129%22%20slang%3D%22en-US%22%3ERe%3A%20Determine%20user's%20access%20to%20a%20particular%20group%20using%20LiQL%20or%20V1%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-552129%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.khoros.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F62383%22%20target%3D%22_blank%22%3E%40IanAtJMP%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3EYou%20can%20do%20it%20in%202%20different%20way%26nbsp%3B%3CBR%20%2F%3Ea)%20Get%20all%20groups%20of%20that%20specific%20user%20using%20below%20query%3CBR%20%2F%3E%26lt%3B%23assign%20myGroups%3D%20rest(%22%2Fgroups%2Ffor%2Fmembers%2Fid%2F%5Buser_id%5D%22).groups.group%20%2F%26gt%3B%3CBR%20%2F%3EAnd%20search%20for%20that%20specific%20group%20if%20it%20exists.%26nbsp%3B%3CBR%20%2F%3Eb)%20Get%20all%20members%20of%20a%20group%20using%20the%20below%20query%20and%20check%20if%20that%20user%20exist%20in%20list%3C%2FP%3E%3CP%3E%26lt%3B%23list%20restadmin(%22%2Fgroups%2Fid%2F%5Bgroup_id%5D%2Fmembers%3Fpage_size%3D999%22).users.user%20as%20member%26gt%3B%3CBR%20%2F%3E%26lt%3B%23if%20member.id%3F%3F%20%26amp%3B%26amp%3B%20(member.id%3Fnumber%20%3D%3D%20user.id)%26gt%3B%3CBR%20%2F%3E%26lt%3B%23assign%20show_module%20%3D%20true%2F%26gt%3B%3CBR%20%2F%3E%26lt%3B%23break%2F%26gt%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EI%20think%20option%20%22a%22%20will%20be%20better%20here.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Esteemed Contributor
Esteemed 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
Highlighted
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...