Using CONTAINS is a PROTECT Rule

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
kklosson
Posts: 1617
Joined: Sun Nov 23, 2008 3:19 pm
Location: Virginia

Using CONTAINS is a PROTECT Rule

Post by kklosson »

I am pretty knowledgeable about using protect rule as I have a multi-tenant application and use them all over the place.
After about 5 hours of work and a thorough search of the board, I am stumped. I have an attribute called HideFrom that captures the full name of an investigator (one or more). The length is 250. If the LoggedIn investigator's full name is found in the attribute, I want to READ PRORECT the object.

Here is my basic syntax that should work but does not. The result is that all objects are read-protected.
IF Candidate.HideFrom CONTAINS LoggedInInvestigator.FullName THEN READ PROTECT Candidate from Investigator.

Here is something that works as expected, but is obviously is not what I want as an outcome:
IF Candidate.HideFrom IS DEFINED THEN READ PROTECT Candidate from Investigator.

Other tests also work fine such as:
IF Candidate.LastName='Smith' THEN READ PROTECT Candidate from Investigator.

I tried something literal:
IF Candidate.HideFrom CONTAINS 'Bill' ==> This would resolve as TRUE
But again, no records we visible.

Conclusion:
Using the HideFrom attribute in conjunction with CONTAINS results in all records being read-protected.
Using the HideFrom attribute in conjunction with IS DEFINED or IS UNDEFINED produced expected results.
Can't use CONTAINS in a protect rule?
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: Using CONTAINS is a PROTECT Rule

Post by aware_support »

Have you checked the rule log?
Aware IM Support Team
kklosson
Posts: 1617
Joined: Sun Nov 23, 2008 3:19 pm
Location: Virginia

Re: Using CONTAINS is a PROTECT Rule

Post by kklosson »

I do not see the rule being executed.

BSV sent as per request.
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Using CONTAINS is a PROTECT Rule

Post by Jaymer »

Try using INDEX_OF to search for the Investigators Name.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: Using CONTAINS is a PROTECT Rule

Post by aware_support »

When the value is undefined CONTAINS doesn't work properly. So your rule should look like this:

IF Candidate.HideFrom IS DEFINED AND Candidate.HideFrom CONTAINS LoggedInInvestigator.FullName THEN READ PROTECT Candidate from Investigator
Aware IM Support Team
Post Reply