-- Pacific Logistics · slice 32 · Cash Flow report
--
-- Grants only. Adds cashFlow permission for the same four roles that
-- can already see the other Financial Reports actions.

INSERT IGNORE INTO user_groups_perms (user_group_id, controller_allowed, action_allowed, created_by, created_on) VALUES
(1,  'FinancialReports', 'cashFlow', 1, NOW()),
(2,  'FinancialReports', 'cashFlow', 1, NOW()),
(3,  'FinancialReports', 'cashFlow', 1, NOW()),
(10, 'FinancialReports', 'cashFlow', 1, NOW());

SELECT ug.user_group_name, GROUP_CONCAT(ugp.action_allowed ORDER BY ugp.action_allowed) AS actions
  FROM user_groups_perms ugp
  JOIN user_groups ug ON ug.c0d = ugp.user_group_id
 WHERE ugp.controller_allowed = 'FinancialReports'
 GROUP BY ug.c0d, ug.user_group_name;
