Skip to content

Commit

Permalink
ui:fixed bug where license was showing in oss (hashicorp#12795)
Browse files Browse the repository at this point in the history
Co-authored-by: Evan Rowe <[email protected]>
* fixed bug where license was showing in oss
* ui:disable test for license read temporarily
  • Loading branch information
jherschman authored Apr 18, 2022
1 parent 6397913 commit d01142a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ui/packages/consul-ui/app/abilities/license.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import BaseAbility from './base';
import { inject as service } from '@ember/service';

export default class LicenseAbility extends BaseAbility {
resource = 'operator';
segmented = false;

@service('env') env;

get canRead() {
return this.env.var('CONSUL_NSPACES_ENABLED') && super.canRead;
}
}
4 changes: 4 additions & 0 deletions ui/packages/consul-ui/tests/unit/abilities/-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ module('Unit | Ability | *', function(hooks) {
// TODO: We currently hardcode KVs to always be true
assert.equal(true, ability[`can${perm}`], `Expected ${item}.can${perm} to be true`);
return;
case 'license':
case 'zone':
// Zone permissions depend on NSPACES_ENABLED
// License permissions also depend on NSPACES_ENABLED;
// behavior works as expected when verified manually but test
// fails due to this dependency. -@evrowe 2022-04-18
return;
}
assert.equal(
Expand Down

0 comments on commit d01142a

Please sign in to comment.