Skip to content

Commit

Permalink
Misc improvements to set access function on security page
Browse files Browse the repository at this point in the history
  • Loading branch information
ganiuszka committed Oct 4, 2024
1 parent c25e90a commit 0b84ab9
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 9 deletions.
Binary file modified Web/Lang/en/messages.mo
Binary file not shown.
3 changes: 3 additions & 0 deletions Web/Lang/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5801,3 +5801,6 @@ msgstr "The OS profiles define the Bacularis and Bacula install and configuratio

msgid "Roles define the Bacularis resources to which users can have access. Roles enable to organize the web interface to give selected users limitted access to some resources, pages and functions. One user can have assigned one or more roles."
msgstr "Roles define the Bacularis resources to which users can have access. Roles enable to organize the web interface to give selected users limitted access to some resources, pages and functions. One user can have assigned one or more roles."

msgid "Select an API host to set resources and permissions. Please note that the 'Main' API host is not listed because the 'Main' is the full access API host and it should not be limited."
msgstr "Select an API host to set resources and permissions. Please note that the 'Main' API host is not listed because the 'Main' is the full access API host and it should not be limited."
Binary file modified Web/Lang/fr/messages.mo
Binary file not shown.
3 changes: 3 additions & 0 deletions Web/Lang/fr/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5812,3 +5812,6 @@ msgstr "The OS profiles define the Bacularis and Bacula install and configuratio

msgid "Roles define the Bacularis resources to which users can have access. Roles enable to organize the web interface to give selected users limitted access to some resources, pages and functions. One user can have assigned one or more roles."
msgstr "Roles define the Bacularis resources to which users can have access. Roles enable to organize the web interface to give selected users limitted access to some resources, pages and functions. One user can have assigned one or more roles."

msgid "Select an API host to set resources and permissions. Please note that the 'Main' API host is not listed because the 'Main' is the full access API host and it should not be limited."
msgstr "Select an API host to set resources and permissions. Please note that the 'Main' API host is not listed because the 'Main' is the full access API host and it should not be limited."
Binary file modified Web/Lang/ja/messages.mo
Binary file not shown.
3 changes: 3 additions & 0 deletions Web/Lang/ja/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5875,3 +5875,6 @@ msgstr "The OS profiles define the Bacularis and Bacula install and configuratio

msgid "Roles define the Bacularis resources to which users can have access. Roles enable to organize the web interface to give selected users limitted access to some resources, pages and functions. One user can have assigned one or more roles."
msgstr "Roles define the Bacularis resources to which users can have access. Roles enable to organize the web interface to give selected users limitted access to some resources, pages and functions. One user can have assigned one or more roles."

msgid "Select an API host to set resources and permissions. Please note that the 'Main' API host is not listed because the 'Main' is the full access API host and it should not be limited."
msgstr "Select an API host to set resources and permissions. Please note that the 'Main' API host is not listed because the 'Main' is the full access API host and it should not be limited."
Binary file modified Web/Lang/ko/messages.mo
Binary file not shown.
3 changes: 3 additions & 0 deletions Web/Lang/ko/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5817,3 +5817,6 @@ msgstr "The OS profiles define the Bacularis and Bacula install and configuratio

msgid "Roles define the Bacularis resources to which users can have access. Roles enable to organize the web interface to give selected users limitted access to some resources, pages and functions. One user can have assigned one or more roles."
msgstr "Roles define the Bacularis resources to which users can have access. Roles enable to organize the web interface to give selected users limitted access to some resources, pages and functions. One user can have assigned one or more roles."

msgid "Select an API host to set resources and permissions. Please note that the 'Main' API host is not listed because the 'Main' is the full access API host and it should not be limited."
msgstr "Select an API host to set resources and permissions. Please note that the 'Main' API host is not listed because the 'Main' is the full access API host and it should not be limited."
Binary file modified Web/Lang/pl/messages.mo
Binary file not shown.
3 changes: 3 additions & 0 deletions Web/Lang/pl/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5811,3 +5811,6 @@ msgstr "The OS profiles define the Bacularis and Bacula install and configuratio

msgid "Roles define the Bacularis resources to which users can have access. Roles enable to organize the web interface to give selected users limitted access to some resources, pages and functions. One user can have assigned one or more roles."
msgstr "Roles define the Bacularis resources to which users can have access. Roles enable to organize the web interface to give selected users limitted access to some resources, pages and functions. One user can have assigned one or more roles."

msgid "Select an API host to set resources and permissions. Please note that the 'Main' API host is not listed because the 'Main' is the full access API host and it should not be limited."
msgstr "Select an API host to set resources and permissions. Please note that the 'Main' API host is not listed because the 'Main' is the full access API host and it should not be limited."
Binary file modified Web/Lang/pt/messages.mo
Binary file not shown.
3 changes: 3 additions & 0 deletions Web/Lang/pt/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5812,3 +5812,6 @@ msgstr "The OS profiles define the Bacularis and Bacula install and configuratio

msgid "Roles define the Bacularis resources to which users can have access. Roles enable to organize the web interface to give selected users limitted access to some resources, pages and functions. One user can have assigned one or more roles."
msgstr "Roles define the Bacularis resources to which users can have access. Roles enable to organize the web interface to give selected users limitted access to some resources, pages and functions. One user can have assigned one or more roles."

msgid "Select an API host to set resources and permissions. Please note that the 'Main' API host is not listed because the 'Main' is the full access API host and it should not be limited."
msgstr "Select an API host to set resources and permissions. Please note that the 'Main' API host is not listed because the 'Main' is the full access API host and it should not be limited."
Binary file modified Web/Lang/ru/messages.mo
Binary file not shown.
3 changes: 3 additions & 0 deletions Web/Lang/ru/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -5811,3 +5811,6 @@ msgstr "The OS profiles define the Bacularis and Bacula install and configuratio

msgid "Roles define the Bacularis resources to which users can have access. Roles enable to organize the web interface to give selected users limitted access to some resources, pages and functions. One user can have assigned one or more roles."
msgstr "Roles define the Bacularis resources to which users can have access. Roles enable to organize the web interface to give selected users limitted access to some resources, pages and functions. One user can have assigned one or more roles."

msgid "Select an API host to set resources and permissions. Please note that the 'Main' API host is not listed because the 'Main' is the full access API host and it should not be limited."
msgstr "Select an API host to set resources and permissions. Please note that the 'Main' API host is not listed because the 'Main' is the full access API host and it should not be limited."
30 changes: 28 additions & 2 deletions Web/Pages/Security.page
Original file line number Diff line number Diff line change
Expand Up @@ -1755,7 +1755,7 @@ $(function() {
<div class="w3-container w3-margin-left w3-margin-right w3-margin-top">
<div class="w3-row directive_field">
<div class="w3-col w3-third"><com:TLabel ForControl="UserAPIHostList" Text="<%[ API host: ]%>"/></div>
<div class="w3-half w3-show-inline-block">
<div class="w3-twothird w3-show-inline-block">
<com:TActiveDropDownList
ID="UserAPIHostList"
CssClass="w3-select w3-border"
Expand All @@ -1779,6 +1779,19 @@ $(function() {
}
</prop:ClientSide.OnComplete>
</com:TActiveDropDownList>
<i class="fas fa-info-circle help_icon w3-text-green" onclick="$('#help_user_api_hosts').slideToggle('fast');"></i>
&nbsp;<i class="fa fa-asterisk w3-text-red opt_req" style="vertical-align: top"></i>
<br />
<com:TRequiredFieldValidator
ControlCssClass="field_invalid"
Display="Dynamic"
ControlToValidate="UserAPIHostList"
ValidationGroup="UserAPIHostResourceAccessGroup"
ErrorMessage="<%[ Field required. ]%>"
/>
<div id="help_user_api_hosts" class="directive_help" style="display: none">
<%[ Select an API host to set resources and permissions. Please note that the 'Main' API host is not listed because the 'Main' is the full access API host and it should not be limited. ]%>
</div>
</div>
</div>
<div id="user_access_window_select_access" style="display: none">
Expand Down Expand Up @@ -4598,7 +4611,7 @@ $(function() {
<div class="w3-container w3-margin-left w3-margin-right w3-margin-top">
<div class="w3-row directive_field">
<div class="w3-col w3-third"><com:TLabel ForControl="APIHostGroupAPIHostList" Text="<%[ API host: ]%>"/></div>
<div class="w3-half w3-show-inline-block">
<div class="w3-twothird w3-show-inline-block">
<com:TActiveDropDownList
ID="APIHostGroupAPIHostList"
CssClass="w3-select w3-border"
Expand All @@ -4622,6 +4635,19 @@ $(function() {
}
</prop:ClientSide.OnComplete>
</com:TActiveDropDownList>
<i class="fas fa-info-circle help_icon w3-text-green" onclick="$('#help_group_api_hosts').slideToggle('fast');"></i>
&nbsp;<i class="fa fa-asterisk w3-text-red opt_req" style="vertical-align: top"></i>
<br />
<com:TRequiredFieldValidator
ControlCssClass="field_invalid"
Display="Dynamic"
ControlToValidate="APIHostGroupAPIHostList"
ValidationGroup="APIHostGroupAPIHostResourceAccessGroup"
ErrorMessage="<%[ Field required. ]%>"
/>
<div id="help_group_api_hosts" class="directive_help" style="display: none">
<%[ Select an API host to set resources and permissions. Please note that the 'Main' API host is not listed because the 'Main' is the full access API host and it should not be limited. ]%>
</div>
</div>
</div>
<div id="api_host_group_access_window_select_access" style="display: none">
Expand Down
10 changes: 3 additions & 7 deletions Web/Pages/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,12 @@ private function setRoles($control, $def_val = null)
* @param object $control control which contains API host list
* @param mixed $def_val default value or null if no default value to set
* @param bool $add_blank_item determines if add first blank item
* @param array $sel_api_hosts defines selected list of API hosts to set. If not set, all API hosts are taken
* @param null|array $sel_api_hosts defines selected list of API hosts to set. If not set, all API hosts are taken
*/
private function setAPIHosts($control, $def_val = null, $add_blank_item = true, $sel_api_hosts = [])
private function setAPIHosts($control, $def_val = null, $add_blank_item = true, $sel_api_hosts = null)
{
$api_hosts = [];
if (count($sel_api_hosts) > 0) {
if (is_array($sel_api_hosts)) {
$api_hosts = $sel_api_hosts;
} else {
$host_config = $this->getModule('host_config')->getConfig();
Expand Down Expand Up @@ -2261,10 +2261,6 @@ public function loadUserAPIHostResourceAccessWindow($sender, $param)
$host_groups = $this->getModule('host_group_config');
$api_hosts = $host_groups->getAPIHostsByGroups($user_config['api_host_groups']);
}
if (count($api_hosts) == 1 && $api_hosts[0] === HostConfig::MAIN_CATALOG_HOST) {
$host_config = $this->getModule('host_config')->getConfig();
$api_hosts = array_keys($host_config);
}
// strip main API host
$cbf = function ($host) {
return ($host !== HostConfig::MAIN_CATALOG_HOST);
Expand Down

0 comments on commit 0b84ab9

Please sign in to comment.