Board visibility privileges in custom component
Hello Community!
We are using a custom component to display Boards, Nested Boards and Blogs on our homepage and the boards' visibilities seem to be screwed up.
Some of these boards have a custom visibility, meaning they are only visible to certain user groups (moderators/admins) or even just individual users. These privileges are set in the lithium backend. The purpose is to have moderator discussion boards, that should not be visible to 'normal' users.
With the standard Board overview component this always worked as expected. If a user with the right privilege opened the page, they saw these boards, if the user did not have the privileges, the user did not see them.
Now, since we are using a custom component, Lithium always displays an error message ('This widget could not be displayed') if the user does not have the right privileges to see it. These error messages are ugly and screw up our layout.
Here's the error we are getting from the REST call we are using
REST Error: path="http://helsana.stage.lithium.com/helsana/restapi/vc/boards/id/mod_discussion?restapi.response_style=view" status="error" code="303" message="Der Benutzer -1 verfügt nicht über die folgenden Berechtigungen bei mod_discussion: [ read_board ]" The failing instruction: ==> #assign boards = rest("/boards/id/{... [in template "community_list" at line 30, column 9]
This is a permission error because we are trying to display the private "mod_discussion" board via the REST API and anonymous users do not have the "Read Board" permission granted by default.
Are there API calls we can use that only return boards if the user has the right privileges to see it?
Please help and Thank you!
Madrian
Not sure if this helps, but you can check a user's permissions to view a specific board like so:
/boards/id/[your board id]/view/allowed
Cheers,
Tyson