Forum Discussion

nickdr_workday's avatar
nickdr_workday
Contributor
4 years ago

Determining message role view access

We are currently working through building the indexing integration for external search  and one of the challenges we are facing is extracting the right roles which have โ€œreadโ€ permission for a message. Currently we can use the query API to return the roles associated with category the permission is set at. By getting the message ID we can determine the board and determine the roles associated with that board but there does not seem to be an endpoint that will tell me if what roles can view this item, example:

// Get the board ID for a message:
select id, topic, type, board.id from messages where id = "5"
select id, roles, messages from nodes where descendants.id = "board:nicks-board-1"
// Loop over all the parent roles that come back.
//Example role query returned from above
// Grab the roles for that category
SELECT id FROM roles where node.id = "category:nicks-category-1"

 What I don't see anywhere in the docs (https://developer.khoros.com/khoroscommunitydevdocs/docs/roles) are where to check if the roles returned have what permissions. 

 

Any help would be greatly appreciated.

  • The permissions for a message pulled in the API are determined on a per-user basis.  In addition, external search usually wants to do its own indexing, so it has a crawler to search messages, meaning that it's usually disconnected from any permissions.  Generally 3rd party search can only index public content.