Add basic logic for managing vaults
This commit is contained in:
@@ -12,7 +12,7 @@ class PolicyModel extends Model {
|
||||
entity_type: String, // user | group
|
||||
entity_id: String,
|
||||
access_type: String, // allow | deny
|
||||
target_type: { type: String, default: 'application' }, // application | api_scope | machine | machine_group
|
||||
target_type: { type: String, default: 'application' }, // application | api_scope | machine | machine_group | vault
|
||||
target_id: String,
|
||||
active: { type: Boolean, default: true },
|
||||
for_permission: { type: Boolean, default: false },
|
||||
@@ -209,6 +209,10 @@ class PolicyModel extends Model {
|
||||
const MachineGroup = this.models.get('ldap:MachineGroup')
|
||||
const group = await MachineGroup.findById(this.target_id)
|
||||
target_display = `Computer Group: ${group.name} (${group.machine_ids.length} computers)`
|
||||
} else if ( this.target_type === 'vault' ) {
|
||||
const Vault = this.models.get('vault:Vault')
|
||||
const vault = await Vault.findById(this.target_id)
|
||||
target_display = `Vault: ${vault.name}`
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user