Skip to content

A Custom Event on Inventory Part In Stock, meant to restrict certain users to only their default site while letting a designated second group of users also work across additional allowed sites tracked via a custom multi-site-allowed field, works correctly for the first group but incorrectly blocks the second group from transacting even on their explicitly allowed additional sites.

Answer

The issue is in how the custom event checks group membership — fetching a single scalar value via a cursor and then comparing it against a string literal doesn't perform a genuine set-membership or per-site check. Replace that logic with a direct existence check instead: run a SELECT COUNT(*) against the multi-site-allowed configuration table, filtering specifically by both the current user AND the specific site/contract being transacted against, then block the transaction only when that count comes back as zero, rather than trying to fetch and compare a single row's value — this correctly validates the user's permission for that exact site rather than incorrectly evaluating group membership.

← Browse Security and access questions