summaryrefslogtreecommitdiff
path: root/src/views/_sila/SecurityAndAccess
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/_sila/SecurityAndAccess')
-rw-r--r--src/views/_sila/SecurityAndAccess/Certificates/Certificates.vue18
-rw-r--r--src/views/_sila/SecurityAndAccess/Ldap/Ldap.vue68
-rw-r--r--src/views/_sila/SecurityAndAccess/Ldap/TableRoleGroups.vue8
-rw-r--r--src/views/_sila/SecurityAndAccess/Policies/Policies.vue11
-rw-r--r--src/views/_sila/SecurityAndAccess/UserManagement/UserManagement.vue19
5 files changed, 46 insertions, 78 deletions
diff --git a/src/views/_sila/SecurityAndAccess/Certificates/Certificates.vue b/src/views/_sila/SecurityAndAccess/Certificates/Certificates.vue
index b7d56e08..c2bc2ac4 100644
--- a/src/views/_sila/SecurityAndAccess/Certificates/Certificates.vue
+++ b/src/views/_sila/SecurityAndAccess/Certificates/Certificates.vue
@@ -37,20 +37,14 @@
v-b-modal.generate-csr
data-test-id="certificates-button-generateCsr"
variant="link"
- :disabled="
- $store.getters['authentication/role'] === 'ReadOnly' ||
- $store.getters['authentication/role'] === 'Operator'
- "
+ :disabled="isNotAdmin"
>
<icon-add />
{{ $t('pageCertificates.generateCsr') }}
</b-button>
<b-button
variant="primary"
- :disabled="
- certificatesForUpload.length === 0 ||
- $store.getters['authentication/role'] === 'ReadOnly'
- "
+ :disabled="certificatesForUpload.length === 0 || isNotAdmin"
@click="initModalUploadCertificate(null)"
>
<icon-add />
@@ -90,7 +84,7 @@
:enabled="action.enabled"
:class="{
disabledDiv:
- $store.getters['authentication/role'] === 'ReadOnly' &&
+ isNotAdmin &&
(action.value === 'delete' || action.value === 'replace'),
}"
@click-table-action="onTableRowAction($event, item)"
@@ -178,6 +172,12 @@ export default {
};
},
computed: {
+ isNotAdmin() {
+ return (
+ this.$store.getters['authentication/role'] === 'ReadOnly' ||
+ this.$store.getters['authentication/role'] === 'Operator'
+ );
+ },
certificates() {
return this.$store.getters['certificates/allCertificates'];
},
diff --git a/src/views/_sila/SecurityAndAccess/Ldap/Ldap.vue b/src/views/_sila/SecurityAndAccess/Ldap/Ldap.vue
index 358cdf70..304ebc03 100644
--- a/src/views/_sila/SecurityAndAccess/Ldap/Ldap.vue
+++ b/src/views/_sila/SecurityAndAccess/Ldap/Ldap.vue
@@ -13,10 +13,7 @@
<b-form-checkbox
v-model="form.ldapAuthenticationEnabled"
data-test-id="ldap-checkbox-ldapAuthenticationEnabled"
- :disabled="
- $store.getters['authentication/role'] === 'ReadOnly' ||
- $store.getters['authentication/role'] === 'Operator'
- "
+ :disabled="isNotAdmin"
@change="onChangeldapAuthenticationEnabled"
>
{{ $t('global.action.enable') }}
@@ -48,8 +45,7 @@
:disabled="
!caCertificateExpiration ||
!ldapCertificateExpiration ||
- $store.getters['authentication/role'] === 'ReadOnly' ||
- $store.getters['authentication/role'] === 'Operator'
+ isNotAdmin
"
@change="$v.form.secureLdapEnabled.$touch()"
>
@@ -83,11 +79,7 @@
v-model="form.activeDirectoryEnabled"
data-test-id="ldap-radio-activeDirectoryEnabled"
:value="false"
- :disabled="
- $store.getters['authentication/role'] ===
- 'ReadOnly' ||
- $store.getters['authentication/role'] === 'Operator'
- "
+ :disabled="isNotAdmin"
@change="onChangeServiceType"
>
OpenLDAP
@@ -96,11 +88,7 @@
v-model="form.activeDirectoryEnabled"
data-test-id="ldap-radio-activeDirectoryEnabled"
:value="true"
- :disabled="
- $store.getters['authentication/role'] ===
- 'ReadOnly' ||
- $store.getters['authentication/role'] === 'Operator'
- "
+ :disabled="isNotAdmin"
@change="onChangeServiceType"
>
Active Directory
@@ -123,11 +111,7 @@
v-model="form.serverUri"
data-test-id="ldap-input-serverUri"
:state="getValidationState($v.form.serverUri)"
- :disabled="
- $store.getters['authentication/role'] ===
- 'ReadOnly' ||
- $store.getters['authentication/role'] === 'Operator'
- "
+ :disabled="isNotAdmin"
@change="$v.form.serverUri.$touch()"
/>
<b-form-invalid-feedback role="alert">
@@ -146,11 +130,7 @@
v-model="form.bindDn"
data-test-id="ldap-input-bindDn"
:state="getValidationState($v.form.bindDn)"
- :disabled="
- $store.getters['authentication/role'] ===
- 'ReadOnly' ||
- $store.getters['authentication/role'] === 'Operator'
- "
+ :disabled="isNotAdmin"
@change="$v.form.bindDn.$touch()"
/>
<b-form-invalid-feedback role="alert">
@@ -172,11 +152,7 @@
type="password"
:state="getValidationState($v.form.bindPassword)"
class="form-control-with-button"
- :disabled="
- $store.getters['authentication/role'] ===
- 'ReadOnly' ||
- $store.getters['authentication/role'] === 'Operator'
- "
+ :disabled="isNotAdmin"
@change="$v.form.bindPassword.$touch()"
/>
<b-form-invalid-feedback role="alert">
@@ -195,11 +171,7 @@
v-model="form.baseDn"
data-test-id="ldap-input-baseDn"
:state="getValidationState($v.form.baseDn)"
- :disabled="
- $store.getters['authentication/role'] ===
- 'ReadOnly' ||
- $store.getters['authentication/role'] === 'Operator'
- "
+ :disabled="isNotAdmin"
@change="$v.form.baseDn.$touch()"
/>
<b-form-invalid-feedback role="alert">
@@ -219,11 +191,7 @@
id="user-id-attribute"
v-model="form.userIdAttribute"
data-test-id="ldap-input-userIdAttribute"
- :disabled="
- $store.getters['authentication/role'] ===
- 'ReadOnly' ||
- $store.getters['authentication/role'] === 'Operator'
- "
+ :disabled="isNotAdmin"
@change="$v.form.userIdAttribute.$touch()"
/>
</b-form-group>
@@ -240,11 +208,7 @@
id="group-id-attribute"
v-model="form.groupIdAttribute"
data-test-id="ldap-input-groupIdAttribute"
- :disabled="
- $store.getters['authentication/role'] ===
- 'ReadOnly' ||
- $store.getters['authentication/role'] === 'Operator'
- "
+ :disabled="isNotAdmin"
@change="$v.form.groupIdAttribute.$touch()"
/>
</b-form-group>
@@ -260,11 +224,7 @@
variant="primary"
type="submit"
data-test-id="ldap-button-saveSettings"
- :disabled="
- loading ||
- $store.getters['authentication/role'] === 'ReadOnly' ||
- $store.getters['authentication/role'] === 'Operator'
- "
+ :disabled="loading || isNotAdmin"
>
{{ $t('global.action.saveSettings') }}
</b-btn>
@@ -335,6 +295,12 @@ export default {
'ldap',
'activeDirectory',
]),
+ isNotAdmin() {
+ return (
+ this.$store.getters['authentication/role'] === 'ReadOnly' ||
+ this.$store.getters['authentication/role'] === 'Operator'
+ );
+ },
sslCertificates() {
return this.$store.getters['certificates/allCertificates'];
},
diff --git a/src/views/_sila/SecurityAndAccess/Ldap/TableRoleGroups.vue b/src/views/_sila/SecurityAndAccess/Ldap/TableRoleGroups.vue
index 6168ae63..13247e24 100644
--- a/src/views/_sila/SecurityAndAccess/Ldap/TableRoleGroups.vue
+++ b/src/views/_sila/SecurityAndAccess/Ldap/TableRoleGroups.vue
@@ -11,10 +11,7 @@
<b-col class="text-right" md="9">
<b-btn
variant="primary"
- :disabled="
- !isServiceEnabled ||
- $store.getters['authentication/role'] === 'ReadOnly'
- "
+ :disabled="!isServiceEnabled || isNotAdmin"
@click="initRoleGroupModal(null)"
>
<icon-add />
@@ -162,6 +159,9 @@ export default {
},
computed: {
...mapGetters('ldap', ['isServiceEnabled', 'enabledRoleGroups']),
+ isNotAdmin() {
+ return this.$store.getters['authentication/role'] === 'ReadOnly';
+ },
tableItems() {
return this.enabledRoleGroups.map(({ LocalRole, RemoteGroup }) => {
return {
diff --git a/src/views/_sila/SecurityAndAccess/Policies/Policies.vue b/src/views/_sila/SecurityAndAccess/Policies/Policies.vue
index 8e690557..d3f2ffcb 100644
--- a/src/views/_sila/SecurityAndAccess/Policies/Policies.vue
+++ b/src/views/_sila/SecurityAndAccess/Policies/Policies.vue
@@ -16,7 +16,7 @@
v-model="sshProtocolState"
data-test-id="policies-toggle-bmcShell"
switch
- :disabled="$store.getters['authentication/role'] === 'ReadOnly'"
+ :disabled="isNotAdmin"
@change="changeSshProtocolState"
>
<span class="sr-only">
@@ -42,7 +42,7 @@
v-model="ipmiProtocolState"
data-test-id="polices-toggle-networkIpmi"
switch
- :disabled="$store.getters['authentication/role'] === 'ReadOnly'"
+ :disabled="isNotAdmin"
@change="changeIpmiProtocolState"
>
<span class="sr-only">
@@ -68,7 +68,7 @@
v-model="vtpmState"
data-test-id="policies-toggle-vtpm"
switch
- :disabled="$store.getters['authentication/role'] === 'ReadOnly'"
+ :disabled="isNotAdmin"
@change="changeVtpmState"
>
<span class="sr-only">
@@ -94,7 +94,7 @@
v-model="rtadState"
data-test-id="policies-toggle-rtad"
switch
- :disabled="$store.getters['authentication/role'] === 'ReadOnly'"
+ :disabled="isNotAdmin"
@change="changeRtadState"
>
<span class="sr-only">
@@ -133,6 +133,9 @@ export default {
};
},
computed: {
+ isNotAdmin() {
+ return this.$store.getters['authentication/role'] === 'ReadOnly';
+ },
sshProtocolState: {
get() {
return this.$store.getters['policies/sshProtocolEnabled'];
diff --git a/src/views/_sila/SecurityAndAccess/UserManagement/UserManagement.vue b/src/views/_sila/SecurityAndAccess/UserManagement/UserManagement.vue
index 8c073224..ed09564c 100644
--- a/src/views/_sila/SecurityAndAccess/UserManagement/UserManagement.vue
+++ b/src/views/_sila/SecurityAndAccess/UserManagement/UserManagement.vue
@@ -5,10 +5,7 @@
<b-col xl="9" class="text-right">
<b-button
variant="link"
- :disabled="
- $store.getters['authentication/role'] === 'ReadOnly' ||
- $store.getters['authentication/role'] === 'Operator'
- "
+ :disabled="isNotAdmin"
@click="initModalSettings"
>
<icon-settings />
@@ -17,10 +14,7 @@
<b-button
variant="primary"
data-test-id="userManagement-button-addUser"
- :disabled="
- $store.getters['authentication/role'] === 'ReadOnly' ||
- $store.getters['authentication/role'] === 'Operator'
- "
+ :disabled="isNotAdmin"
@click="initModalUser(null)"
>
<icon-add />
@@ -81,8 +75,7 @@
:title="action.title"
:class="{
disabledDiv:
- ($store.getters['authentication/role'] === 'ReadOnly' ||
- $store.getters['authentication/role'] === 'Operator') &&
+ isNotAdmin &&
(action.value === 'delete' || action.value === 'edit'),
}"
@click-table-action="onTableRowAction($event, item)"
@@ -217,6 +210,12 @@ export default {
};
},
computed: {
+ isNotAdmin() {
+ return (
+ this.$store.getters['authentication/role'] === 'ReadOnly' ||
+ this.$store.getters['authentication/role'] === 'Operator'
+ );
+ },
allUsers() {
return this.$store.getters['userManagement/allUsers'];
},