fix: Model parameter save permission error#3989
Conversation
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| <el-button type="primary" @click="submit" :loading="loading"> | ||
| {{ $t('common.confirm') }} | ||
| </el-button> | ||
| </span> |
There was a problem hiding this comment.
The code looks clean and does not have any apparent issues that would affect functionality or performance. However, there is a small potential issue with conditional rendering of the "Cancel" button. If permissionPrecise.paramSetting(modelID) evaluates to false, then the cancel button will remain visible even if it doesn't serve any purpose due to lack of permission.
To address this, you might want to add an additional condition to check whether the user has both read and write permissions before making the 'Cancel' button accessible:
<span class="operation-buttons">
<el-button @click.prevent="dialogVisible = false">{{ $t('common.cancel') }}</el-button>
<el-button
type="primary"
@click="submit"
:loading="loading"
v-if="hasEditPermission && !permissionPrecise.paramSetting(modelID)"> <!-- Ensure editing permission -->
{{ $t('common.confirm') }}
</el-button>
</span>Where hasEditPermission is a property that checks whether the current user possesses the necessary rights (both reading and writing) on the specified model (modelID). This approach ensures that only users with appropriate privileges can access the confirmation button during parameter setting operations.
fix: Model parameter save permission error