Forum Discussion

stevensullivan's avatar
8 years ago

How to check if a user has permission to read a board

Right now there is a method that checks if the user has a permission on the current node, "coreNode.permissions.hasPermission("PROPERTY")"

 

I wonder if there is any way that I can check the permissions on some other node. My current use case for this is to create a menu. If a user has permission to read a board, the board should be included in the menu. If not, it should be omitted.

 

I tried getting the node object and passing it like "THISNODE.permissions.hasPermission("PROPERTY")" but no luck. 

 

Maybe there is some other way? Or maybe im using it wrong/syntax error.

  • Hi,

    You could try using REST API call to check if user is allowed to see a board. Following is the REST API you can use:
    /restapi/vc/boards/id/[id]/view/allowed

    Regards,
    Madhu