Skip to content

Commit

Permalink
ITKDev: Code review ajustments
Browse files Browse the repository at this point in the history
Co-authored-by: Jeppe Kuhlmann Andersen <[email protected]>
  • Loading branch information
cableman and jekuaitk committed Dec 12, 2024
1 parent 5924d6c commit 84e2716
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion modules/os2web_audit_entity/os2web_audit_entity.info.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "OS2web Audit logging entity access"
description: "Logs CUD events for entities"
description: "Logs CRUD events for entities"
type: module
core_version_requirement: ^8 || ^9 || ^10
dependencies:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
os2web_audit_entity.admin_settings:
title: 'OS2web Audit entity settings'
parent: system.admin_config_system
description: 'Settings for the OS2 Audit entity module'
description: 'Settings for the OS2web Audit entity module'
route_name: os2web_audit_entity.settings
8 changes: 1 addition & 7 deletions modules/os2web_audit_entity/os2web_audit_entity.module
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ function os2web_audit_entity_webform_post_load_data(mixed $submissions): void {

// Detect field of type that contains "cpr" in name or where field name
// contains "cpr".
/** @var \Drupal\webform_revisions\Entity\WebformRevisions $webform */
$webform = $submission->getWebform();
$elements = $webform->getElementsDecoded();
foreach ($elements as $fieldName => $element) {
Expand Down Expand Up @@ -125,12 +124,7 @@ function os2web_audit_entity_log(string $message): void {

// Detect user type.
$account = \Drupal::currentUser();
$apiUser = FALSE;
if (os2web_audit_entity_is_api_user($account)) {
$apiUser = TRUE;
}

$metadata['userId'] = $account->getEmail();
$metadata['userType'] = $apiUser ? 'api' : 'web';
$metadata['userType'] = os2web_audit_entity_is_api_user($account) ? 'api' : 'web';
$logger->info('Entity', $message, FALSE, $metadata);
}
4 changes: 2 additions & 2 deletions modules/os2web_audit_entity/src/Form/SettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public function buildForm(array $form, FormStateInterface $form_state): array {

$form['roles'] = [
'#type' => 'checkboxes',
'#title' => $this->t('Choose an Option'),
'#description' => $this->t('Please select an option from the dropdown menu.'),
'#title' => $this->t('Select API access roles'),
'#description' => $this->t('The selected roles will be use to determine who is accessing entities through the API.'),
'#options' => $items,
'#default_value' => $config->get('roles') ?? [],
'#required' => TRUE,
Expand Down

0 comments on commit 84e2716

Please sign in to comment.