mirror of https://github.com/status-im/consul.git
16 lines
403 B
JavaScript
16 lines
403 B
JavaScript
|
import { helper } from '@ember/component/helper';
|
||
|
|
||
|
export default helper(function serviceIntentionPermissions([params] /*, hash*/) {
|
||
|
const hasPermissions = params.Intention.HasPermissions;
|
||
|
const allowed = params.Intention.Allowed;
|
||
|
|
||
|
switch (true) {
|
||
|
case hasPermissions:
|
||
|
return 'allow';
|
||
|
case !allowed && !hasPermissions:
|
||
|
return 'deny';
|
||
|
default:
|
||
|
return 'allow';
|
||
|
}
|
||
|
});
|