mirror of
https://github.com/status-im/consul.git
synced 2025-01-09 21:35:52 +00:00
8263879e6f
This commit use the internal authorize endpoint along wiht ember-can to further restrict user access to certain UI features and navigational elements depending on the users ACL token
18 lines
480 B
JavaScript
18 lines
480 B
JavaScript
import { modifier } from 'ember-modifier';
|
|
|
|
export default modifier(function enabled($element, [bool], hash) {
|
|
if (['input', 'textarea', 'select', 'button'].includes($element.nodeName.toLowerCase())) {
|
|
if (bool) {
|
|
$element.disabled = bool;
|
|
} else {
|
|
$element.dataset.disabled = false;
|
|
}
|
|
return;
|
|
}
|
|
for (const $el of $element.querySelectorAll('input,textarea')) {
|
|
if ($el.dataset.disabled !== 'false') {
|
|
$el.disabled = bool;
|
|
}
|
|
}
|
|
});
|