There's certainly the BEFORE SQL QUERY event to add a WHERE clause to a table, but I didn't see one for the preview or detail link on a master-detail relationship.
This application is for events with tasks. Depending on where the user comes from in the larger Intranet application, only the events/tasks for a specific user, or specific team, or a global view with no restrictions is needed. It's easy to set a $_SESSION variable from a $_REQUEST parameter, but it's not easy to put that value in the WHERE of the detail/preview query - unless I've overlooked something.
So is there a global variable that would have the WHERE string for all tables, or at least the preview/details/detail_count queries that a list "before query" event could set to add some predicates?
Any ideas on a different approach? I tried adding the predicate to the table's SQL, but couldn't get past the syntax error for the $_SESSION variable. Also got error when manually editing the generated variables include member.