Quantcast
Viewing all articles
Browse latest Browse all 2504

ROQL query - calculate "user access" access mask

Topic by Kurt Helfrich

Content

I have a case where I'm trying to get a count of new or updated answers for a page where customers can click a link related to a product or category that they added to product or category notifications and see either new or updated answers for the product or category for the last 7 days.

The following code produces the query for the new answers by category, but it doesn't honor the logged-in contact's access rights, so the counts may be off from what the contact can actually see when I create a link to the answers/list page to look at the new or updated answers.

Answers have an AccessLevels member, but how can I calculate what the user's access to use with it?

We assign access levels to SLA instances attached to orgs, and I'm sure I can (laboriously) calculate the access mask (I have some code that does that kind of thing somewhere...), but I'm hoping there is an easy shortcut that I'm missing.

 

 

Version

May 2016, CP3.2, Connect PHP v1.2

Code Block


Viewing all articles
Browse latest Browse all 2504

Trending Articles