github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/app/components/global-header.js (about) 1 import Component from '@ember/component'; 2 import classic from 'ember-classic-decorator'; 3 import { inject as service } from '@ember/service'; 4 import { attributeBindings } from '@ember-decorators/component'; 5 6 @classic 7 @attributeBindings('data-test-global-header') 8 export default class GlobalHeader extends Component { 9 @service config; 10 @service system; 11 12 'data-test-global-header' = true; 13 onHamburgerClick() {} 14 15 // Show sign-in if: 16 // - User can't load agent config (meaning ACLs are enabled but they're not signed in) 17 // - User can load agent config in and ACLs are enabled (meaning ACLs are enabled and they're signed in) 18 // The excluded case here is if there is both an agent config and ACLs are disabled 19 get shouldShowProfileNav() { 20 return ( 21 !this.system.agent?.get('config') || 22 this.system.agent?.get('config.ACL.Enabled') === true 23 ); 24 } 25 }