Forum Discussion

CarolineS's avatar
10 months ago
Solved

How to determine if a given node is visible to the public?

Hello! I am trying to figure out if it's possible, via API, to determine if a given node is visible to the public. E.g. is the "read posts" permission granted by default on that node.  (which I supp...
  • Claudius's avatar
    10 months ago

    coreNode.permissions.hasPermission context object probably is the closest you can get. But it's rather limited as you can only check for the current user AND current node. E.g. you cannot use it easily in a navigation component to show/hide elements without reading permissions.

    I'm wondering what you are trying to build though that wouldn't work with Khoros built-in permissioning? The API is quite good at hiding stuff where the current user doesn't have read permissions. Isn't that sufficient for your use case?