diff --git a/Web/Lang/en/messages.mo b/Web/Lang/en/messages.mo index 126ec7f..8ee8389 100644 Binary files a/Web/Lang/en/messages.mo and b/Web/Lang/en/messages.mo differ diff --git a/Web/Lang/en/messages.po b/Web/Lang/en/messages.po index e5510f3..27efb97 100644 --- a/Web/Lang/en/messages.po +++ b/Web/Lang/en/messages.po @@ -5182,3 +5182,21 @@ msgstr "The API host groups are named sets of API hosts which can be used to ass msgid "Assign to API host groups:" msgstr "Assign to API host groups:" + +msgid "Bacula Console ACL" +msgstr "Bacula Console ACL" + +msgid "Assigned" +msgstr "Assigned" + +msgid "unassign" +msgstr "unassign" + +msgid "Set API host access to resources" +msgstr "Set API host access to resources" + +msgid "Set user API host access to resources" +msgstr "Set user API host access to resources" + +msgid "Set API host group access to resources" +msgstr "Set API host group access to resources" diff --git a/Web/Lang/fr/messages.mo b/Web/Lang/fr/messages.mo index 75d822f..3cc2f5e 100644 Binary files a/Web/Lang/fr/messages.mo and b/Web/Lang/fr/messages.mo differ diff --git a/Web/Lang/fr/messages.po b/Web/Lang/fr/messages.po index e93e693..0cd53d6 100644 --- a/Web/Lang/fr/messages.po +++ b/Web/Lang/fr/messages.po @@ -5193,3 +5193,21 @@ msgstr "The API host groups are named sets of API hosts which can be used to ass msgid "Assign to API host groups:" msgstr "Assign to API host groups:" + +msgid "Bacula Console ACL" +msgstr "Bacula Console ACL" + +msgid "Assigned" +msgstr "Assigned" + +msgid "unassign" +msgstr "unassign" + +msgid "Set API host access to resources" +msgstr "Set API host access to resources" + +msgid "Set user API host access to resources" +msgstr "Set user API host access to resources" + +msgid "Set API host group access to resources" +msgstr "Set API host group access to resources" diff --git a/Web/Lang/ja/messages.mo b/Web/Lang/ja/messages.mo index ccc7169..25c68c8 100644 Binary files a/Web/Lang/ja/messages.mo and b/Web/Lang/ja/messages.mo differ diff --git a/Web/Lang/ja/messages.po b/Web/Lang/ja/messages.po index 05db446..bcc6bbc 100644 --- a/Web/Lang/ja/messages.po +++ b/Web/Lang/ja/messages.po @@ -5256,3 +5256,21 @@ msgstr "The API host groups are named sets of API hosts which can be used to ass msgid "Assign to API host groups:" msgstr "Assign to API host groups:" + +msgid "Bacula Console ACL" +msgstr "Bacula Console ACL" + +msgid "Assigned" +msgstr "Assigned" + +msgid "unassign" +msgstr "unassign" + +msgid "Set API host access to resources" +msgstr "Set API host access to resources" + +msgid "Set user API host access to resources" +msgstr "Set user API host access to resources" + +msgid "Set API host group access to resources" +msgstr "Set API host group access to resources" diff --git a/Web/Lang/ko/messages.mo b/Web/Lang/ko/messages.mo index 84eba4c..73bea67 100644 Binary files a/Web/Lang/ko/messages.mo and b/Web/Lang/ko/messages.mo differ diff --git a/Web/Lang/ko/messages.po b/Web/Lang/ko/messages.po index f51b0ac..b108ef1 100644 --- a/Web/Lang/ko/messages.po +++ b/Web/Lang/ko/messages.po @@ -5198,3 +5198,21 @@ msgstr "The API host groups are named sets of API hosts which can be used to ass msgid "Assign to API host groups:" msgstr "Assign to API host groups:" + +msgid "Bacula Console ACL" +msgstr "Bacula Console ACL" + +msgid "Assigned" +msgstr "Assigned" + +msgid "unassign" +msgstr "unassign" + +msgid "Set API host access to resources" +msgstr "Set API host access to resources" + +msgid "Set user API host access to resources" +msgstr "Set user API host access to resources" + +msgid "Set API host group access to resources" +msgstr "Set API host group access to resources" diff --git a/Web/Lang/pl/messages.mo b/Web/Lang/pl/messages.mo index e0fad7b..0291f01 100644 Binary files a/Web/Lang/pl/messages.mo and b/Web/Lang/pl/messages.mo differ diff --git a/Web/Lang/pl/messages.po b/Web/Lang/pl/messages.po index 767b8c7..5361e79 100644 --- a/Web/Lang/pl/messages.po +++ b/Web/Lang/pl/messages.po @@ -5193,3 +5193,21 @@ msgstr "The API host groups are named sets of API hosts which can be used to ass msgid "Assign to API host groups:" msgstr "Assign to API host groups:" + +msgid "Bacula Console ACL" +msgstr "Bacula Console ACL" + +msgid "Assigned" +msgstr "Assigned" + +msgid "unassign" +msgstr "unassign" + +msgid "Set API host access to resources" +msgstr "Set API host access to resources" + +msgid "Set user API host access to resources" +msgstr "Set user API host access to resources" + +msgid "Set API host group access to resources" +msgstr "Set API host group access to resources" diff --git a/Web/Lang/pt/messages.mo b/Web/Lang/pt/messages.mo index 405dfe8..8932a06 100644 Binary files a/Web/Lang/pt/messages.mo and b/Web/Lang/pt/messages.mo differ diff --git a/Web/Lang/pt/messages.po b/Web/Lang/pt/messages.po index c420cff..e371cc0 100644 --- a/Web/Lang/pt/messages.po +++ b/Web/Lang/pt/messages.po @@ -5193,3 +5193,21 @@ msgstr "The API host groups are named sets of API hosts which can be used to ass msgid "Assign to API host groups:" msgstr "Assign to API host groups:" + +msgid "Bacula Console ACL" +msgstr "Bacula Console ACL" + +msgid "Assigned" +msgstr "Assigned" + +msgid "unassign" +msgstr "unassign" + +msgid "Set API host access to resources" +msgstr "Set API host access to resources" + +msgid "Set user API host access to resources" +msgstr "Set user API host access to resources" + +msgid "Set API host group access to resources" +msgstr "Set API host group access to resources" diff --git a/Web/Lang/ru/messages.mo b/Web/Lang/ru/messages.mo index 8f623a1..3057ceb 100644 Binary files a/Web/Lang/ru/messages.mo and b/Web/Lang/ru/messages.mo differ diff --git a/Web/Lang/ru/messages.po b/Web/Lang/ru/messages.po index 905bf30..be745f6 100644 --- a/Web/Lang/ru/messages.po +++ b/Web/Lang/ru/messages.po @@ -5192,3 +5192,21 @@ msgstr "The API host groups are named sets of API hosts which can be used to ass msgid "Assign to API host groups:" msgstr "Assign to API host groups:" + +msgid "Bacula Console ACL" +msgstr "Bacula Console ACL" + +msgid "Assigned" +msgstr "Assigned" + +msgid "unassign" +msgstr "unassign" + +msgid "Set API host access to resources" +msgstr "Set API host access to resources" + +msgid "Set user API host access to resources" +msgstr "Set user API host access to resources" + +msgid "Set API host group access to resources" +msgstr "Set API host group access to resources" diff --git a/Web/Pages/Security.page b/Web/Pages/Security.page index 2ef6be9..98bb141 100644 --- a/Web/Pages/Security.page +++ b/Web/Pages/Security.page @@ -1257,6 +1257,24 @@ var oUserList = { { data: 'username', render: function (data, type, row) { + let btns = ''; + + // Set access button + const span = document.createElement('SPAN'); + const access_btn = document.createElement('BUTTON'); + access_btn.className = 'w3-button w3-green'; + access_btn.type = 'button'; + const i = document.createElement('I'); + i.className = 'fas fa-edit'; + const label = document.createTextNode(' <%[ Set access ]%>'); + access_btn.appendChild(i); + access_btn.innerHTML += ' '; + access_btn.appendChild(label); + access_btn.setAttribute('onclick', 'oUsers.load_user_access_window("' + data + '")'); + span.appendChild(access_btn); + span.style.marginRight = '5px'; + btns += span.outerHTML; + var btn_edit = document.createElement('BUTTON'); btn_edit.className = 'w3-button w3-green'; btn_edit.type = 'button'; @@ -1268,7 +1286,9 @@ var oUserList = { btn_edit.style.marginRight = '8px'; btn_edit.appendChild(label_edit); btn_edit.setAttribute('onclick', 'oUsers.load_user_window(\'' + data + '\')'); - return btn_edit.outerHTML; + btns += btn_edit.outerHTML; + + return btns; } } ], @@ -1283,7 +1303,7 @@ var oUserList = { targets: 0 }, { - className: 'action_col', + className: 'action_col_long', orderable: false, targets: [ 11 ] }, @@ -1424,6 +1444,36 @@ var oUsers = { }, save_user_cb: function() { document.getElementById('user_window').style.display = 'none'; + }, + load_user_access_window: function(name) { + this.clear_access_window(); + document.getElementById('<%=$this->UserAPIHostResourceAccessName->ClientID%>').value = name; + const cb = <%=$this->LoadUserAPIHostResourceAccess->ActiveControl->Javascript%>; + cb.setCallbackParameter(name); + cb.dispatch(); + document.getElementById('user_access_window_title').textContent = name; + document.getElementById('user_access_window').style.display = 'block'; + }, + clear_access_window: function() { + // empty fields + [ + '<%=$this->UserAPIHostResourceAccessJobs->ClientID%>' + ].forEach((id) => { + $('#' + id).empty(); + }); + + // reset radio buttons + document.getElementById('<%=$this->UserAPIHostResourceAccessAllResources->ClientID%>').checked = true; + document.getElementById('user_access_window_error').style.display = 'none'; + document.getElementById('user_access_window_console').style.display = 'none'; + document.getElementById('user_access_window_select_jobs').style.display = 'none'; + document.getElementById('user_access_window_select_access').style.display = 'none'; + }, + unassign_console: function() { + const api_host = document.getElementById('<%=$this->UserAPIHostList->ClientID%>').value; + const cb = <%=$this->UnassignUserAPIHostConsole->ActiveControl->Javascript%>; + cb.setCallbackParameter(api_host); + cb.dispatch(); } } @@ -1673,6 +1723,112 @@ $(function() { +
+
+
+ × +

- <%[ Set user API host access to resources ]%>  

+
+
+
+
+
+ + + document.getElementById('get_api_host_loader').style.visibility = 'visible'; + const sa = document.getElementById('user_access_window_select_access'); + sa.style.display = 'none'; + + + document.getElementById('get_api_host_loader').style.visibility = 'hidden'; + const el = document.getElementById('<%=$this->UserAPIHostList->ClientID%>'); + const sa = document.getElementById('user_access_window_select_access'); + const err = document.getElementById('user_access_window_error'); + if (err.style.display == 'none') { + sa.style.display = el.value ? 'block' : 'none'; + } else { + sa.style.display = 'none'; + } + + +
+
+ + +
+
+ + +  <%[ Save ]%> + +
+ +
+ + + document.getElementById('get_api_host_loader').style.visibility = 'visible'; + + + document.getElementById('get_api_host_loader').style.visibility = 'hidden'; + + + +