diff --git a/backend/app_tests/test_vars.py b/backend/app_tests/test_vars.py index aa048b63a..fe9384a92 100644 --- a/backend/app_tests/test_vars.py +++ b/backend/app_tests/test_vars.py @@ -1,6 +1,6 @@ from typing import Any from core.apps import ( - AUDITOR_PERMISSIONS_LIST, + READER_PERMISSIONS_LIST, APPROVER_PERMISSIONS_LIST, ANALYST_PERMISSIONS_LIST, DOMAIN_MANAGER_PERMISSIONS_LIST, @@ -44,8 +44,8 @@ }, "BI-UG-GAD": { "folder": "Global", - "name": "Global_auditor", - "perms": AUDITOR_PERMISSIONS_LIST, + "name": "Global_reader", + "perms": READER_PERMISSIONS_LIST, }, "BI-UG-GAP": { "folder": "Global", @@ -54,8 +54,8 @@ }, "BI-UG-AUD": { "folder": "test", - "name": "Auditor", - "perms": AUDITOR_PERMISSIONS_LIST, + "name": "Reader", + "perms": READER_PERMISSIONS_LIST, }, "BI-UG-APP": { "folder": "test", diff --git a/backend/core/apps.py b/backend/core/apps.py index 4846d60cc..9d49751c9 100644 --- a/backend/core/apps.py +++ b/backend/core/apps.py @@ -3,7 +3,7 @@ from ciso_assistant.settings import CISO_ASSISTANT_SUPERUSER_EMAIL import os -AUDITOR_PERMISSIONS_LIST = [ +READER_PERMISSIONS_LIST = [ "view_project", "view_riskassessment", "view_appliedcontrol", @@ -251,8 +251,8 @@ def startup(**kwargs): print("startup handler: initialize database") - auditor_permissions = Permission.objects.filter( - codename__in=AUDITOR_PERMISSIONS_LIST + reader_permissions = Permission.objects.filter( + codename__in=READER_PERMISSIONS_LIST ) approver_permissions = Permission.objects.filter( @@ -277,8 +277,8 @@ def startup(**kwargs): name="Global", content_type=Folder.ContentType.ROOT, builtin=True ) # update builtin roles to facilitate migrations - auditor, created = Role.objects.get_or_create(name="BI-RL-AUD", builtin=True) - auditor.permissions.set(auditor_permissions) + reader, created = Role.objects.get_or_create(name="BI-RL-AUD", builtin=True) + reader.permissions.set(reader_permissions) approver, created = Role.objects.get_or_create(name="BI-RL-APP", builtin=True) approver.permissions.set(approver_permissions) analyst, created = Role.objects.get_or_create(name="BI-RL-ANA", builtin=True) @@ -302,23 +302,23 @@ def startup(**kwargs): folder=Folder.get_root_folder(), ) ra1.perimeter_folders.add(administrators.folder) - # if global auditors user group does not exist, then create it + # if global readers user group does not exist, then create it if not UserGroup.objects.filter( name="BI-UG-GAD", folder=Folder.get_root_folder() ).exists(): - global_auditors = UserGroup.objects.create( + global_readers = UserGroup.objects.create( name="BI-UG-GAD", folder=Folder.objects.get(content_type=Folder.ContentType.ROOT), builtin=True, ) ra2 = RoleAssignment.objects.create( - user_group=global_auditors, + user_group=global_readers, role=Role.objects.get(name="BI-RL-AUD"), is_recursive=True, builtin=True, folder=Folder.get_root_folder(), ) - ra2.perimeter_folders.add(global_auditors.folder) + ra2.perimeter_folders.add(global_readers.folder) # if global approvers user group does not exist, then create it if not UserGroup.objects.filter( name="BI-UG-GAP", folder=Folder.get_root_folder() diff --git a/backend/core/tests/test_helpers.py b/backend/core/tests/test_helpers.py index 8068e4db2..ef5abe66b 100644 --- a/backend/core/tests/test_helpers.py +++ b/backend/core/tests/test_helpers.py @@ -44,7 +44,7 @@ def test_get_rating_options_perm_to_view_matrix(): ) RiskScenario.objects.create(name="test", risk_assessment=risk_assessment) role = Role.objects.create(name="test") - auditor_permissions = Permission.objects.filter( + reader_permissions = Permission.objects.filter( codename__in=[ "view_project", "view_riskassessment", @@ -58,7 +58,7 @@ def test_get_rating_options_perm_to_view_matrix(): "view_usergroup", ] ) - role.permissions.set(auditor_permissions) + role.permissions.set(reader_permissions) role.save() role_assignment = RoleAssignment.objects.create( user=user, @@ -109,7 +109,7 @@ def test_get_rating_options_abbr_perm_to_view_matrix(): ) RiskScenario.objects.create(name="test", risk_assessment=risk_assessment) role = Role.objects.create(name="test") - auditor_permissions = Permission.objects.filter( + reader_permissions = Permission.objects.filter( codename__in=[ "view_project", "view_riskassessment", @@ -123,7 +123,7 @@ def test_get_rating_options_abbr_perm_to_view_matrix(): "view_usergroup", ] ) - role.permissions.set(auditor_permissions) + role.permissions.set(reader_permissions) role.save() role_assignment = RoleAssignment.objects.create( user=user, diff --git a/backend/core/utils.py b/backend/core/utils.py index 7c6775169..8c65a4a77 100644 --- a/backend/core/utils.py +++ b/backend/core/utils.py @@ -14,7 +14,7 @@ class RoleCodename(Enum): DOMAIN_MANAGER = "BI-RL-DMA" ANALYST = "BI-RL-ANA" APPROVER = "BI-RL-APP" - AUDITOR = "BI-RL-AUD" + READER = "BI-RL-AUD" def __str__(self) -> str: return self.value @@ -22,12 +22,12 @@ def __str__(self) -> str: class UserGroupCodename(Enum): ADMINISTRATOR = "BI-UG-ADM" - GLOBAL_AUDITOR = "BI-UG-GAD" + GLOBAL_READER = "BI-UG-GAD" GLOBAL_APPROVER = "BI-UG-GAP" DOMAIN_MANAGER = "BI-UG-DMA" ANALYST = "BI-UG-ANA" APPROVER = "BI-UG-APP" - AUDITOR = "BI-UG-AUD" + READER = "BI-UG-AUD" def __str__(self) -> str: return self.value @@ -38,17 +38,17 @@ def __str__(self) -> str: str(RoleCodename.DOMAIN_MANAGER): _("Domain manager"), str(RoleCodename.ANALYST): _("Analyst"), str(RoleCodename.APPROVER): _("Approver"), - str(RoleCodename.AUDITOR): _("Auditor"), + str(RoleCodename.READER): _("Reader"), } BUILTIN_USERGROUP_CODENAMES = { str(UserGroupCodename.ADMINISTRATOR): _("Administrator"), - str(UserGroupCodename.GLOBAL_AUDITOR): _("Auditor"), + str(UserGroupCodename.GLOBAL_READER): _("Reader"), str(UserGroupCodename.GLOBAL_APPROVER): _("Approver"), str(UserGroupCodename.DOMAIN_MANAGER): _("Domain manager"), str(UserGroupCodename.ANALYST): _("Analyst"), str(UserGroupCodename.APPROVER): _("Approver"), - str(UserGroupCodename.AUDITOR): _("Auditor"), + str(UserGroupCodename.READER): _("Reader"), } COUNTRY_FLAGS = { diff --git a/backend/core/views.py b/backend/core/views.py index b53230040..da1613d8b 100644 --- a/backend/core/views.py +++ b/backend/core/views.py @@ -903,8 +903,8 @@ def perform_create(self, serializer): serializer.save() folder = Folder.objects.get(id=serializer.data["id"]) if folder.content_type == Folder.ContentType.DOMAIN: - auditors = UserGroup.objects.create( - name=UserGroupCodename.AUDITOR, folder=folder, builtin=True + readers = UserGroup.objects.create( + name=UserGroupCodename.READER, folder=folder, builtin=True ) approvers = UserGroup.objects.create( name=UserGroupCodename.APPROVER, folder=folder, builtin=True @@ -916,8 +916,8 @@ def perform_create(self, serializer): name=UserGroupCodename.DOMAIN_MANAGER, folder=folder, builtin=True ) ra1 = RoleAssignment.objects.create( - user_group=auditors, - role=Role.objects.get(name=RoleCodename.AUDITOR), + user_group=readers, + role=Role.objects.get(name=RoleCodename.READER), builtin=True, folder=Folder.get_root_folder(), is_recursive=True, diff --git a/frontend/messages/en.json b/frontend/messages/en.json index fafe5215a..87b03ea6b 100644 --- a/frontend/messages/en.json +++ b/frontend/messages/en.json @@ -367,7 +367,7 @@ "extraLarge": "Extra-large", "rid": "RID", "scope": "Scope", - "auditor": "Auditor", + "reader": "Reader", "lastUpdate": "Last update", "riskScenarioAssetHelpText": "Assets impacted by this risk scenario", "riskScenarioMeasureHelpText": "The existing applied controls to manage this risk", diff --git a/frontend/messages/fr.json b/frontend/messages/fr.json index 795adb0bd..cc9bf0d5c 100644 --- a/frontend/messages/fr.json +++ b/frontend/messages/fr.json @@ -367,7 +367,7 @@ "extraLarge": "Très grand", "rid": "RID", "scope": "Périmètre", - "auditor": "Auditor", + "reader": "Lecteur", "lastUpdate": "Dernière mise à jour", "riskScenarioAssetHelpText": "Biens sensibles impactés par ce scénario de risque", "riskScenarioMeasureHelpText": "Les mesures appliquées existantes pour gérer ce risque", diff --git a/frontend/src/lib/utils/locales.ts b/frontend/src/lib/utils/locales.ts index 22b921956..9f31a74fc 100644 --- a/frontend/src/lib/utils/locales.ts +++ b/frontend/src/lib/utils/locales.ts @@ -300,7 +300,7 @@ export function localItems(languageTag: string): LocalItems { notApplicable: m.notApplicable({ languageTag: languageTag }), administrator: m.administrator({ languageTag: languageTag }), analyst: m.analyst({ languageTag: languageTag }), - auditor: m.auditor({ languageTag: languageTag }), + reader: m.reader({ languageTag: languageTag }), domainManager: m.domainManager({ languageTag: languageTag }), authors: m.authors({ languageTag: languageTag }), reviewers: m.reviewers({ languageTag: languageTag }), diff --git a/frontend/tests/utils/test-data.ts b/frontend/tests/utils/test-data.ts index c0b948b06..687ccd051 100644 --- a/frontend/tests/utils/test-data.ts +++ b/frontend/tests/utils/test-data.ts @@ -76,8 +76,8 @@ export default { "view_user", ] }, - auditor: { - name: 'Auditor', + reader: { + name: 'Reader', perms: [ "view_project", "view_riskassessment", diff --git a/frontend/tests/utils/test-utils.ts b/frontend/tests/utils/test-utils.ts index 81799c90c..92605b53b 100644 --- a/frontend/tests/utils/test-utils.ts +++ b/frontend/tests/utils/test-utils.ts @@ -359,7 +359,7 @@ export class TestContent { last_name: vars.user.lastName, user_groups: [ `${vars.folderName} - ${vars.usergroups.analyst.name}`, - `${vars.folderName} - ${vars.usergroups.auditor.name}`, + `${vars.folderName} - ${vars.usergroups.reader.name}`, `${vars.folderName} - ${vars.usergroups.domainManager.name}`, `${vars.folderName} - ${vars.usergroups.approver.name}` ],