mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-20 17:11:37 +00:00
Compare commits
2 Commits
pr@dev@k8s
...
v2.22.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6644778cd3 | ||
|
|
f3978263f8 |
@@ -84,15 +84,21 @@ export default {
|
|||||||
extraQuery: this.extraQuery
|
extraQuery: this.extraQuery
|
||||||
})
|
})
|
||||||
const formatterArgs = {
|
const formatterArgs = {
|
||||||
'columnsMeta.actions.formatterArgs.canUpdate': 'change',
|
'columnsMeta.actions.formatterArgs.canUpdate': () => {
|
||||||
|
return this.hasActionPerm('change') && !this.currentOrgIsRoot
|
||||||
|
},
|
||||||
'columnsMeta.actions.formatterArgs.canDelete': 'delete',
|
'columnsMeta.actions.formatterArgs.canDelete': 'delete',
|
||||||
'columnsMeta.actions.formatterArgs.canClone': 'add',
|
'columnsMeta.actions.formatterArgs.canClone': () => {
|
||||||
|
return this.hasActionPerm('add') && !this.currentOrgIsRoot
|
||||||
|
},
|
||||||
'columnsMeta.name.formatterArgs.can': 'view'
|
'columnsMeta.name.formatterArgs.can': 'view'
|
||||||
}
|
}
|
||||||
for (const [arg, action] of Object.entries(formatterArgs)) {
|
for (const [arg, action] of Object.entries(formatterArgs)) {
|
||||||
const notSet = _.get(config, arg) === undefined
|
const notSet = _.get(config, arg) === undefined
|
||||||
|
const isFunction = typeof action === 'function'
|
||||||
if (notSet) {
|
if (notSet) {
|
||||||
_.set(config, arg, this.hasActionPerm(action))
|
const hasActionPerm = isFunction ? action() : this.hasActionPerm(action)
|
||||||
|
_.set(config, arg, hasActionPerm)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.$log.debug('Header actions', this.headerActions)
|
this.$log.debug('Header actions', this.headerActions)
|
||||||
|
|||||||
@@ -692,7 +692,7 @@
|
|||||||
"AssetPermissionUpdate": "Asset permissions update",
|
"AssetPermissionUpdate": "Asset permissions update",
|
||||||
"AssetUpdate": "Asset update",
|
"AssetUpdate": "Asset update",
|
||||||
"Assets": "Assets",
|
"Assets": "Assets",
|
||||||
"LogsAudits": "Logs audit",
|
"LogsAudit": "Logs audit",
|
||||||
"SessionsAudit": "Sessions audit",
|
"SessionsAudit": "Sessions audit",
|
||||||
"SessionList": "Session list",
|
"SessionList": "Session list",
|
||||||
"BatchCommand": "Batch Command",
|
"BatchCommand": "Batch Command",
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export default {
|
|||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
canClone: vm.$hasPerm('assets.add_platform'),
|
canClone: () => vm.$hasPerm('assets.add_platform'),
|
||||||
canUpdate: ({ row }) => !row.internal && vm.$hasPerm('assets.change_platform'),
|
canUpdate: ({ row }) => !row.internal && vm.$hasPerm('assets.change_platform'),
|
||||||
canDelete: ({ row }) => !row.internal && vm.$hasPerm('assets.delete_platform')
|
canDelete: ({ row }) => !row.internal && vm.$hasPerm('assets.delete_platform')
|
||||||
}
|
}
|
||||||
@@ -34,7 +34,10 @@ export default {
|
|||||||
hasRightActions: true,
|
hasRightActions: true,
|
||||||
hasMoreActions: false,
|
hasMoreActions: false,
|
||||||
hasBulkDelete: false,
|
hasBulkDelete: false,
|
||||||
createRoute: 'PlatformCreate'
|
createRoute: 'PlatformCreate',
|
||||||
|
canCreate: () => {
|
||||||
|
return this.$hasPerm('assets.add_platform')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user