Hi Rudy, here is the final actual query:
JOIN `gp_permissions` ON `gp_permissions`.`role_id` = `gp_users_roles`.`role_id`
WHERE (module = '' OR module IS NULL)
AND (controller = 'users' OR controller IS NULL)
AND (method = 'dashboard' OR method IS NULL)
AND `gp_users_roles`.`user_id` = 2
I didn't specify where module, controller, and method are coming from because I am using an active record class with a database prefix and it will defeat the database prefix cause because of the way I have to write those WHERE with OR statements in them. I can assure you though they are not ambiguous.