The CreatorCon Call for Content is officially open! Get started here.

User criteria script is not taking effect

Nisar2
Mega Guru

I've a catalog item for which the "Available For" and "Not Available For" values are as follows:

Nisar2_0-1692258197783.png

 

The user criteria record is as follows:

Nisar2_1-1692258236190.png


You can see that I'm defaulting it to "false", which means any user trying to access the item should not be able to. I then tried testing it via the "User Criteria Diagnostics" module and found the following result:

Nisar2_2-1692258303628.png

Why does it say that the user "Can view" the catalog item when the criteria says "false"?

 

I tried:

  • Using cache.do
  • Logging out and logging back in

But still got the same result.

 

What am I missing here?

1 ACCEPTED SOLUTION

Niklas Peterson
Mega Sage

Hi,

 

Doesn't Not available for == False means it is available? You need to reverse the logic.

Regards,
Niklas

View solution in original post

6 REPLIES 6

Niklas Peterson
Mega Sage

Hi,

 

Doesn't Not available for == False means it is available? You need to reverse the logic.

Regards,
Niklas

That's interesting. I did that and return true and guess what?


For 1st user it worked and did not allow to view.

For 2nd user it allowed to view.

 

The difference in roles/access between 1st and 2nd shouldn't matter, right? Since the function is always returning "true".

Hi,
If I remember correctly then Admin access by passes user criteria but other roles/access should not make a difference.

Regards,
Niklas

Both users are non-admin. Also, interestingly, this is what I see for the 2nd user

Nisar2_0-1692268463812.png

You can see that it says "Cannot view" but it's not because of the user criteria since the "person" icon isn't present under "User Match".

So what else could be causing the issue? There's nothing in the entitlement script of the catalog item too.