I have a domain class lets say
class ListItem {
Long tenantId
}
I want to create a namedquery like such
active {
Long currentTenantId = ?????????;
or {
isNull('tenantId')
eq ('tenantId', currentTenantId);
}
}
In otherwords I want there to be ListItem records what everyone can access and listItem records ONLY the tenant can access.
Browsing the source of the plugin I cannot see how I can find out the current tenant without adding a service ref.
Is this possible?
EDIT: The intention is that currentTentantId is not passed as a parameter. Maybe I am being idealistic.