When adding users to group in Can View User Criteria and then to group in Cannot View or vice versa

GeetashreeK
Tera Contributor

Hi!

 

I have a question about Can View/Cannot View User Criterias, and adding them to groups from Can View and Cannot View, both.

 

Consider there are two groups, groupA and groupB, and we add groupA in Can View User Criteria and groupB in Cannot View User Criteria. Users who are in groupA will have access to page/widget and users in groupB will not. Now, add open one of the user record from groupA and add him to groupB.

 

According to the documentations, Cannot View holds more precedence. So, the user should not be able to access the page/widget. But I do not see that happening.

 

I tried clearing cache, in cache.do which worked. I want to understand why this happens. And if we will have to clear cache every time a user is added to a group/added a role? Anyone who know why this happens? Or if there's an alternate approach?

 

To add,

I have used glideRecord in User Criteria for both Can View and Cannot View. I have an inkling if its behaving that ways because of this.

 

Thank you

 

4 REPLIES 4

Zach Koch
Giga Sage
Giga Sage

Can you post screenshots of how both of your User Criteria records, both for Can  and Cannot? From the sound of it, that could be the issue.

If this information helped resolve your issue, please remember to mark response correct and thumbs up to help future community members on this information, thanks!

Hi, thanks for responding!
 
This is in Cannot View Criteria:
GeetashreeK_0-1728479093297.png

 

Script in Can View User Criteria:

GeetashreeK_1-1728479127832.png

 

In your block for Entity Manager/PM, for your glideRecord, can you confirm that it is finding a record? Have you put a log statement in your if block to ensure something is actually being found?

If this information helped resolve your issue, please remember to mark response correct and thumbs up to help future community members on this information, thanks!

Hi

 

Yes, it serves the purpose Zach.

I tried removing glide record and it still behaves the same way. Now we are clear that its not glide record that is causing the issue