diff options
Diffstat (limited to 'src/views/_sila/SecurityAndAccess')
5 files changed, 60 insertions, 5 deletions
diff --git a/src/views/_sila/SecurityAndAccess/Certificates/Certificates.vue b/src/views/_sila/SecurityAndAccess/Certificates/Certificates.vue index 27950b76..cdfb1e47 100644 --- a/src/views/_sila/SecurityAndAccess/Certificates/Certificates.vue +++ b/src/views/_sila/SecurityAndAccess/Certificates/Certificates.vue @@ -37,13 +37,17 @@ v-b-modal.generate-csr data-test-id="certificates-button-generateCsr" variant="link" + :disabled="$store.getters['authentication/role'] === 'ReadOnly'" > <icon-add /> {{ $t('pageCertificates.generateCsr') }} </b-button> <b-button variant="primary" - :disabled="certificatesForUpload.length === 0" + :disabled=" + certificatesForUpload.length === 0 || + $store.getters['authentication/role'] === 'ReadOnly' + " @click="initModalUploadCertificate(null)" > <icon-add /> @@ -81,6 +85,11 @@ :value="action.value" :title="action.title" :enabled="action.enabled" + :class="{ + disabledDiv: + $store.getters['authentication/role'] === 'ReadOnly' && + (action.value === 'delete' || action.value === 'replace'), + }" @click-table-action="onTableRowAction($event, item)" > <template #icon> diff --git a/src/views/_sila/SecurityAndAccess/Ldap/Ldap.vue b/src/views/_sila/SecurityAndAccess/Ldap/Ldap.vue index 6800ead5..12584fac 100644 --- a/src/views/_sila/SecurityAndAccess/Ldap/Ldap.vue +++ b/src/views/_sila/SecurityAndAccess/Ldap/Ldap.vue @@ -13,6 +13,7 @@ <b-form-checkbox v-model="form.ldapAuthenticationEnabled" data-test-id="ldap-checkbox-ldapAuthenticationEnabled" + :disabled="$store.getters['authentication/role'] === 'ReadOnly'" @change="onChangeldapAuthenticationEnabled" > {{ $t('global.action.enable') }} @@ -42,7 +43,9 @@ aria-describedby="enable-secure-help-block" data-test-id="ldap-checkbox-secureLdapEnabled" :disabled=" - !caCertificateExpiration || !ldapCertificateExpiration + !caCertificateExpiration || + !ldapCertificateExpiration || + $store.getters['authentication/role'] === 'ReadOnly' " @change="$v.form.secureLdapEnabled.$touch()" > @@ -76,6 +79,9 @@ v-model="form.activeDirectoryEnabled" data-test-id="ldap-radio-activeDirectoryEnabled" :value="false" + :disabled=" + $store.getters['authentication/role'] === 'ReadOnly' + " @change="onChangeServiceType" > OpenLDAP @@ -84,6 +90,9 @@ v-model="form.activeDirectoryEnabled" data-test-id="ldap-radio-activeDirectoryEnabled" :value="true" + :disabled=" + $store.getters['authentication/role'] === 'ReadOnly' + " @change="onChangeServiceType" > Active Directory @@ -106,6 +115,9 @@ v-model="form.serverUri" data-test-id="ldap-input-serverUri" :state="getValidationState($v.form.serverUri)" + :disabled=" + $store.getters['authentication/role'] === 'ReadOnly' + " @change="$v.form.serverUri.$touch()" /> <b-form-invalid-feedback role="alert"> @@ -124,6 +136,9 @@ v-model="form.bindDn" data-test-id="ldap-input-bindDn" :state="getValidationState($v.form.bindDn)" + :disabled=" + $store.getters['authentication/role'] === 'ReadOnly' + " @change="$v.form.bindDn.$touch()" /> <b-form-invalid-feedback role="alert"> @@ -145,6 +160,9 @@ type="password" :state="getValidationState($v.form.bindPassword)" class="form-control-with-button" + :disabled=" + $store.getters['authentication/role'] === 'ReadOnly' + " @change="$v.form.bindPassword.$touch()" /> <b-form-invalid-feedback role="alert"> @@ -163,6 +181,9 @@ v-model="form.baseDn" data-test-id="ldap-input-baseDn" :state="getValidationState($v.form.baseDn)" + :disabled=" + $store.getters['authentication/role'] === 'ReadOnly' + " @change="$v.form.baseDn.$touch()" /> <b-form-invalid-feedback role="alert"> @@ -182,6 +203,9 @@ id="user-id-attribute" v-model="form.userIdAttribute" data-test-id="ldap-input-userIdAttribute" + :disabled=" + $store.getters['authentication/role'] === 'ReadOnly' + " @change="$v.form.userIdAttribute.$touch()" /> </b-form-group> @@ -198,6 +222,9 @@ id="group-id-attribute" v-model="form.groupIdAttribute" data-test-id="ldap-input-groupIdAttribute" + :disabled=" + $store.getters['authentication/role'] === 'ReadOnly' + " @change="$v.form.groupIdAttribute.$touch()" /> </b-form-group> @@ -213,7 +240,9 @@ variant="primary" type="submit" data-test-id="ldap-button-saveSettings" - :disabled="loading" + :disabled=" + loading || $store.getters['authentication/role'] === 'ReadOnly' + " > {{ $t('global.action.saveSettings') }} </b-btn> diff --git a/src/views/_sila/SecurityAndAccess/Ldap/TableRoleGroups.vue b/src/views/_sila/SecurityAndAccess/Ldap/TableRoleGroups.vue index ca52da13..6168ae63 100644 --- a/src/views/_sila/SecurityAndAccess/Ldap/TableRoleGroups.vue +++ b/src/views/_sila/SecurityAndAccess/Ldap/TableRoleGroups.vue @@ -11,7 +11,10 @@ <b-col class="text-right" md="9"> <b-btn variant="primary" - :disabled="!isServiceEnabled" + :disabled=" + !isServiceEnabled || + $store.getters['authentication/role'] === 'ReadOnly' + " @click="initRoleGroupModal(null)" > <icon-add /> diff --git a/src/views/_sila/SecurityAndAccess/Policies/Policies.vue b/src/views/_sila/SecurityAndAccess/Policies/Policies.vue index 0de80de2..8e690557 100644 --- a/src/views/_sila/SecurityAndAccess/Policies/Policies.vue +++ b/src/views/_sila/SecurityAndAccess/Policies/Policies.vue @@ -16,6 +16,7 @@ v-model="sshProtocolState" data-test-id="policies-toggle-bmcShell" switch + :disabled="$store.getters['authentication/role'] === 'ReadOnly'" @change="changeSshProtocolState" > <span class="sr-only"> @@ -41,6 +42,7 @@ v-model="ipmiProtocolState" data-test-id="polices-toggle-networkIpmi" switch + :disabled="$store.getters['authentication/role'] === 'ReadOnly'" @change="changeIpmiProtocolState" > <span class="sr-only"> @@ -66,6 +68,7 @@ v-model="vtpmState" data-test-id="policies-toggle-vtpm" switch + :disabled="$store.getters['authentication/role'] === 'ReadOnly'" @change="changeVtpmState" > <span class="sr-only"> @@ -91,6 +94,7 @@ v-model="rtadState" data-test-id="policies-toggle-rtad" switch + :disabled="$store.getters['authentication/role'] === 'ReadOnly'" @change="changeRtadState" > <span class="sr-only"> diff --git a/src/views/_sila/SecurityAndAccess/UserManagement/UserManagement.vue b/src/views/_sila/SecurityAndAccess/UserManagement/UserManagement.vue index ae8c5209..e65b00df 100644 --- a/src/views/_sila/SecurityAndAccess/UserManagement/UserManagement.vue +++ b/src/views/_sila/SecurityAndAccess/UserManagement/UserManagement.vue @@ -3,13 +3,18 @@ <page-title /> <b-row> <b-col xl="9" class="text-right"> - <b-button variant="link" @click="initModalSettings"> + <b-button + variant="link" + :disabled="$store.getters['authentication/role'] === 'ReadOnly'" + @click="initModalSettings" + > <icon-settings /> {{ $t('pageUserManagement.accountPolicySettings') }} </b-button> <b-button variant="primary" data-test-id="userManagement-button-addUser" + :disabled="$store.getters['authentication/role'] === 'ReadOnly'" @click="initModalUser(null)" > <icon-add /> @@ -68,6 +73,11 @@ :value="action.value" :enabled="action.enabled" :title="action.title" + :class="{ + disabledDiv: + $store.getters['authentication/role'] === 'ReadOnly' && + (action.value === 'delete' || action.value === 'edit'), + }" @click-table-action="onTableRowAction($event, item)" > <template #icon> |