mirror of
https://github.com/status-im/consul.git
synced 2025-01-25 05:00:32 +00:00
75768a2039
* Request peering permissions when peerings is active * Update peering ability to use peering resource * fix canDelete peer permission to check write permission * use super call in abilities.peer#canDelete
22 lines
521 B
JavaScript
22 lines
521 B
JavaScript
import BaseAbility from 'consul-ui/abilities/base';
|
|
import { inject as service } from '@ember/service';
|
|
|
|
export default class PeerAbility extends BaseAbility {
|
|
@service('env') env;
|
|
|
|
resource = 'peering';
|
|
segmented = false;
|
|
|
|
get isLinkable() {
|
|
return this.canDelete;
|
|
}
|
|
get canDelete() {
|
|
// TODO: Need to confirm these states
|
|
return !['DELETING', 'TERMINATED', 'UNDEFINED'].includes(this.item.State) && super.canDelete;
|
|
}
|
|
|
|
get canUse() {
|
|
return this.env.var('CONSUL_PEERING_ENABLED');
|
|
}
|
|
}
|