diff --git a/src/UwRoles/UwRoles.php b/src/UwRoles/UwRoles.php index 74d07924ce586ad40335e677b7d9e1009a5c736e..d233e0ced9f0bb39aa7b751ff586dc31d6feafb1 100644 --- a/src/UwRoles/UwRoles.php +++ b/src/UwRoles/UwRoles.php @@ -40,8 +40,8 @@ class UwRoles { return [ 'uw_role_site_owner', 'uw_role_site_manager', - 'uw_role_content_author', 'uw_role_content_editor', + 'uw_role_content_author', 'uw_role_form_editor', 'uw_role_form_results_access', 'uw_role_private_content_viewer', @@ -98,12 +98,12 @@ class UwRoles { case 'uw_role_site_manager': return 'Site manager'; - case 'uw_role_content_author': - return 'Content author'; - case 'uw_role_content_editor': return 'Content editor'; + case 'uw_role_content_author': + return 'Content author'; + case 'uw_role_form_editor': return 'Form editor'; diff --git a/uw_cfg_common.install b/uw_cfg_common.install index c5c52ba5b5d140c8f0eba37bc50e8d4917f44e37..a2b1beee53046875df309196ab88223b9e3725ed 100644 --- a/uw_cfg_common.install +++ b/uw_cfg_common.install @@ -708,3 +708,22 @@ function uw_cfg_common_update_9106(&$sandbox) { } } } + +/** + * Swap the order of content author and editor roles. + */ +function uw_cfg_common_update_9107(&$sandbox) { + // The original weight of content editor role is 5. + // The original weight of content author role is 4. + $role_ids = [ + 'uw_role_content_editor' => 4, + 'uw_role_content_author' => 5, + ]; + // Set new weight of content editor role as 4. + // Set new weight of content author role as 5. + foreach ($role_ids as $role_id => $weight) { + $role = Role::load($role_id); + $role->setWeight($weight); + $role->save(); + } +}