diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2014-07-31 10:14:32 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2014-09-11 17:55:17 +0200 |
commit | 7e7fe57fc9098e81ce90f4d56b1a3154abfa6123 (patch) | |
tree | 33279df63d761453e5381e25d8fd1436b7944783 /install/ui/src/freeipa/widget.js | |
parent | 2b2f37981147e7cd74a2e42f5802c717b01b6ca8 (diff) | |
download | freeipa-7e7fe57fc9098e81ce90f4d56b1a3154abfa6123.tar.gz freeipa-7e7fe57fc9098e81ce90f4d56b1a3154abfa6123.tar.xz freeipa-7e7fe57fc9098e81ce90f4d56b1a3154abfa6123.zip |
webui: hide non-readable fields
hide widgets if associated field had received attribute level rights
without 'r' right.
Explicit rights are required to avoid hiding of special widgets which
are not associated with any LDAP attribute.
https://fedorahosted.org/freeipa/ticket/4402
Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
Diffstat (limited to 'install/ui/src/freeipa/widget.js')
-rw-r--r-- | install/ui/src/freeipa/widget.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js index d5837e7ea..252fe0208 100644 --- a/install/ui/src/freeipa/widget.js +++ b/install/ui/src/freeipa/widget.js @@ -406,6 +406,9 @@ IPA.input_widget = function(spec) { */ that.ctor_init = function() { on(that, 'value-change', that.hide_if_empty); + on(that, 'readable-change', function() { + that.set_visible(); + }); }; /** @@ -641,9 +644,22 @@ IPA.input_widget = function(spec) { if (that.has_value === false && !that.is_writable() && that.hidden_if_empty) { visible = false; } + if (that.readable !== undefined) { + visible = visible && that.readable; + } return visible; }; + that.set_readable = function(readable) { + + var old = that.readable; + that.readable = readable; + + if (old !== that.readable) { + that.emit('readable-change', { source: that, readable: readable }); + } + }; + /** * Widget is writable * @return {boolean} |