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