Repository navigation
fix: application overview web access permission error - #7941
Merged
peslyn merged 1 commit intoNov 16, 2026
Merged
Conversation
shaohuzhang1
commented
Nov 16, 2026
| <el-button v-if="applicationOverviewPermission('overviewPublic')" text :loading="loading" @click="handleResetAccessToken"> | ||
| <MkIcon name="icon_refresh_outlined" /> | ||
| </el-button> | ||
| </div> |
Contributor
Author
There was a problem hiding this comment.
The one-line change is syntactically valid Vue template code. No obvious syntax irregularity in the diff. However, there are several review points:
-
Permission semantics may be wrong
overviewPublicsounds like a “view public overview” permission, not necessarily a permission to reset an access token.- Resetting an access link is a security-sensitive write action. Use a dedicated permission such as
overviewPublicResetToken/resetAccessTokenif available. - Confirm the permission key with the backend/RBAC design.
-
Frontend hiding is not authorization
v-ifonly hides the button. The reset API must still enforce the same permission server-side and return403if unauthorized.
-
Reactivity concern
- If
applicationOverviewPermission()depends on a reactive permission store, the template will re-render correctly. - If it reads from a non-reactive global or is async,
v-ifmay not update correctly. Prefer a computed property:
- If
const canResetAccessToken = computed(() =>
applicationOverviewPermission('overviewPublicResetToken')
)<el-button
v-if="canResetAccessToken"
text
:loading="loading"
@click="handleResetAccessToken"
>
<MkIcon name="icon_refresh_outlined" />
</el-button>-
Ensure the permission function returns a synchronous boolean
- If it returns a
Promise,v-ifwill treat it as truthy. Permission checks in templates should be synchronous.
- If it returns a
-
Check import/definition
- Make sure
applicationOverviewPermissionis imported or defined in this component; otherwise it will fail at runtime.
- Make sure
-
Shared
loadingstate- If
loadingis shared by multiple buttons/actions, resetting the token may make unrelated buttons show loading. Consider a dedicatedresettingAccessTokenstate.
- If
-
UX/security suggestions
- Add a confirmation dialog before resetting the access link.
- Handle API success/failure and clear loading in
finally. - Add
aria-labelortitlefor the icon-only button, e.g. “Reset access link”. - Add tests for permission granted/denied behavior.
Overall: the change is safe syntactically, but verify the permission key is the correct one, keep the check reactive, and ensure backend authorization is also enforced.
peslyn
deleted the
pr@v3@fix_application_overview_web_access_permission_error
branch
November 16, 2026 08:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: application overview web access permission error