-- Social media permissions for HOD
SET @social_media_datagroup_id := (SELECT id FROM ohrm_data_group WHERE `name` = 'social_media');

SET @HOD_user_role := (SELECT id FROM ohrm_user_role WHERE `name` = 'HeadOfDepartment');

INSERT INTO `ohrm_user_role_data_group` (`user_role_id`, `data_group_id`, `can_read`, `can_create`, `can_update`, `can_delete`, `self`)
VALUES (@HOD_user_role, @social_media_datagroup_id, '1', '1', '1', '1', '0');

-- Application change log permission for Admin snd SysAdmin
INSERT INTO `ohrm_data_group` (`name`, `description`, `can_read`, `can_create`, `can_update`, `can_delete`) VALUES
('application_change_log', 'ADMIN - Application Change Log', 1, NULL, NULL, NULL);

SET @application_change_log_datagroup_id := (SELECT id FROM ohrm_data_group WHERE `name` = 'application_change_log');

SET @admin_user_role := (SELECT id FROM ohrm_user_role WHERE `name` = 'Admin');

INSERT INTO `ohrm_user_role_data_group` (`user_role_id`, `data_group_id`, `can_read`, `can_create`, `can_update`, `can_delete`, `self`)
VALUES (@admin_user_role , @application_change_log_datagroup_id, '1', NULL, NULL, NULL, '0');