Skip to content

Commit

Permalink
fix: Workspace members with only the 'App Template Viewing' permissio…
Browse files Browse the repository at this point in the history
…n are allowed to replace Helm charts (#3441)

Signed-off-by: TheYoungManLi <cjl@kubesphere.io>
  • Loading branch information
weili520 authored Jul 18, 2022
1 parent 588ef1c commit f78df70
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/pages/apps/components/Cards/ConfigFile/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ export default class ConfigFile extends React.Component {
appName: '',
}

get hasPermission() {
return globals.app.hasPermission({
module: 'app-templates',
actions: ['manage', 'edit'],
})
}

constructor(props) {
super(props)

Expand Down Expand Up @@ -119,7 +126,9 @@ export default class ConfigFile extends React.Component {
type={'MODIFY_VERSION'}
appId={detail.app_id}
versionId={detail.version_id}
canEdit={CAN_EDIT_STATUS.includes(detail.status)}
canEdit={
this.hasPermission && CAN_EDIT_STATUS.includes(detail.status)
}
className={styles.uploadInfo}
hasPackage
/>
Expand Down

0 comments on commit f78df70

Please sign in to comment.