Skip to content

Commit

Permalink
add option to restrict access to the logs for DAGs
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewPoppe committed Jan 25, 2023
1 parent b8d6f66 commit c815329
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@
}
]
},
{
"key": "prevent_logs_for_dags",
"name": "<strong>Restrict Logging for DAG Users</strong>: Choose whether to disable the logging feature for users currently in a Data Access Group<br>Default setting is to restrict access",
"type": "dropdown",
"choices": [
{
"value": 0,
"name": "Disable Logging access for users in a DAG"
},
{
"value": 1,
"name": "Allow all users to see all logging"
}
]
},
{
"key": "restrict-access",
"name": "<strong>Restrict User Access</strong>: Choose whether to restrict access to certain users in the project or to allow access to all users.<br>If you choose to restrict access, you will be able to select which individual users have access to this module.<br>Default is to allow all users to access the module",
Expand Down
8 changes: 8 additions & 0 deletions logging_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
$module->showPageHeader("logging_table");
$module->initializeJavascriptModuleObject();

// If user is in a DAG and settings are appropriate, don't show the logging table.
$current_dag = $module->getCurrentDag($module->getProject()->getProjectId(), $module->getUser()->getUsername());
$prevent_dags_from_seeing_logs = $module->getProjectSetting("prevent_logs_for_dags");
if ($current_dag != null && $prevent_dags_from_seeing_logs != "1") {
echo "<span style='color:#C00000; margin-bottom: 5px;'>Since you have been assigned to a Data Access Group, you are not able to view the User Rights History logs.</span><br>";
exit();
}

// Get User's Date Format
$date_format = \DateTimeRC::get_user_format_php();
$time_format = explode("_", \DateTimeRC::get_user_format_full(), 2)[1];
Expand Down

0 comments on commit c815329

Please sign in to comment.