USE lifanghe_education;

UPDATE roles
SET permissions = JSON_ARRAY()
WHERE role = 'parent';

UPDATE roles
SET permissions = JSON_ARRAY('*:*:*')
WHERE role = 'super_admin';

UPDATE roles
SET permissions = JSON_ARRAY(
  'dashboard:view',
  'system:user:view',
  'system:role:view',
  'leads:view',
  'leads:advance',
  'points:view',
  'points:rule',
  'courses:view',
  'courses:add',
  'courses:edit',
  'statistics:view'
)
WHERE role = 'campus_admin';

UPDATE roles
SET permissions = JSON_ARRAY('dashboard:view', 'leads:view', 'leads:advance', 'courses:view', 'points:view')
WHERE role = 'advisor';

UPDATE roles
SET permissions = JSON_ARRAY('dashboard:view', 'leads:view', 'courses:view')
WHERE role = 'teacher';

UPDATE roles
SET permissions = JSON_ARRAY('dashboard:view', 'points:view', 'points:adjust', 'points:rule', 'points:reward', 'statistics:view')
WHERE role = 'finance';
