Forum Discussion

dhiraj_gophane's avatar
12 years ago

Rest API to get the groups available to current user

Hi all, How can I get list of groups that are accessible to current logged in user. Is there any direct API which will give us the groups which user can access.   The list should contain:   1) ...
  • AdamN's avatar
    AdamN
    12 years ago

    If you're not seeing any groups, I'd suggest double checking your default permissions for groups to ensure that users have access to see and join groups. You might also want to check to make sure that there isn't any code in your custom component that would be wrapping the REST call and preventing it from occuring (i.e. some other permission/role check you may have added).

     

    One way to do a quick check to see if it's a permission issue vs something with your component would be to create a separate test component and add this snippet:

    <#list rest("/groups/list").groups.group as group>
    ${group.id},
    </#list>

    You could even add it to an announcements section temporarily if you didn't want to create a separate component. If you login as a regular user and view the page this code is on, you should see a list of Group IDs. If you don't, it's likely a permission issue. If you do see it, there's likely an issue with your custom component.