diff options
Diffstat (limited to 'src/views/_sila/SecurityAndAccess/Ldap')
-rw-r--r-- | src/views/_sila/SecurityAndAccess/Ldap/Ldap.vue | 68 | ||||
-rw-r--r-- | src/views/_sila/SecurityAndAccess/Ldap/TableRoleGroups.vue | 8 |
2 files changed, 21 insertions, 55 deletions
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 { |