mislav

Using global variables in a record access privilege calculation doesn't work correctly

Discussion created by mislav on Nov 9, 2018
Latest reply on Nov 12, 2018 by TSGal

Product and version: Database hosted on FileMaker Server 16.0.4 and accessed via FileMaker Pro 17.0.2, 16.0.5, 15.0.4.

 

OS and version: macOS High Sierra 10.13.6

 

Hardware: iMac (late 2015)

 

Description: I set up the View calculation for two of the tables in the database to compare values in a field and in a global variable; e.g. CreatedBy = $$HAS_ACCESS. If this returns true, then the user is able to view the record. I am able to view the records as expected when I'm on a layout based on that table. But searching on "*" doesn't retrieve the records as expected. (Searching on "=" and then omitting the request does work correctly.) And when the record is viewed as a related record, the relationship doesn't match the related record as expected; i.e I'm on a record from table A and have fields from related table B displayed on that layout, and the table A record should match a record in table B, but the related fields show as empty.

 

I've found a few older reports of behavior similar to this:

There is a comment in the latest of these that claims this issue was fixed in FM 15, but it seems to still be there.

 

How to replicate: The behavior is consistent in the database where it's been observed. I tried recreating it in a brand new file but was not able to.

 

Workaround: Use global field instead of global variable.

Outcomes