Skip to content

fix: application overview web access permission error - #7941

Merged
peslyn merged 1 commit into
v3from
pr@v3@fix_application_overview_web_access_permission_error
Nov 16, 2026
Merged

peslyn merged 1 commit into
v3from
pr@v3@fix_application_overview_web_access_permission_error

Conversation

@shaohuzhang1

Copy link
Copy Markdown
Contributor

fix: application overview web access permission error

<el-button v-if="applicationOverviewPermission('overviewPublic')" text :loading="loading" @click="handleResetAccessToken">
<MkIcon name="icon_refresh_outlined" />
</el-button>
</div>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The one-line change is syntactically valid Vue template code. No obvious syntax irregularity in the diff. However, there are several review points:

  1. Permission semantics may be wrong

    • overviewPublic sounds 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 / resetAccessToken if available.
    • Confirm the permission key with the backend/RBAC design.
  2. Frontend hiding is not authorization

    • v-if only hides the button. The reset API must still enforce the same permission server-side and return 403 if unauthorized.
  3. 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-if may not update correctly. Prefer a computed property:
const canResetAccessToken = computed(() =>
  applicationOverviewPermission('overviewPublicResetToken')
)
<el-button
  v-if="canResetAccessToken"
  text
  :loading="loading"
  @click="handleResetAccessToken"
>
  <MkIcon name="icon_refresh_outlined" />
</el-button>
  1. Ensure the permission function returns a synchronous boolean

    • If it returns a Promise, v-if will treat it as truthy. Permission checks in templates should be synchronous.
  2. Check import/definition

    • Make sure applicationOverviewPermission is imported or defined in this component; otherwise it will fail at runtime.
  3. Shared loading state

    • If loading is shared by multiple buttons/actions, resetting the token may make unrelated buttons show loading. Consider a dedicated resettingAccessToken state.
  4. UX/security suggestions

    • Add a confirmation dialog before resetting the access link.
    • Handle API success/failure and clear loading in finally.
    • Add aria-label or title for 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
peslyn merged commit 01ad2a3 into v3 Nov 16, 2026
3 of 4 checks passed
@peslyn
peslyn deleted the pr@v3@fix_application_overview_web_access_permission_error branch November 16, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants