summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2014-07-09 16:49:46 +0200
committerPetr Vobornik <pvoborni@redhat.com>2014-07-21 10:47:06 +0200
commitd2f2fc5addc0634b24ccda7a5aae1ed1d3c6001a (patch)
tree85a49c354669fb2deed8ab1557a7e398925570ae
parent4aefc0d6fe7a4879a9b8024eb7424b4dfa5fa7ca (diff)
downloadfreeipa-d2f2fc5addc0634b24ccda7a5aae1ed1d3c6001a.tar.gz
freeipa-d2f2fc5addc0634b24ccda7a5aae1ed1d3c6001a.tar.xz
freeipa-d2f2fc5addc0634b24ccda7a5aae1ed1d3c6001a.zip
webui: attr widget: get list of possible attrs from ipapermdefaultattr
Very useful for managed permissions since the list of attrs in metadata might be smaller that default attributes. This smooths behavior if one removes an attr from effective attrs which is not in metadata. Without this it will disappear from the list and one has to add it manually through 'Add'. https://fedorahosted.org/freeipa/ticket/4253 Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
-rw-r--r--install/ui/src/freeipa/aci.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/install/ui/src/freeipa/aci.js b/install/ui/src/freeipa/aci.js
index 4cf93c9b1..d4eb0febe 100644
--- a/install/ui/src/freeipa/aci.js
+++ b/install/ui/src/freeipa/aci.js
@@ -898,6 +898,16 @@ aci.permission_target_policy = function (spec) {
var attribute_table = that.permission_target.widgets.get_widget('attrs');
var skip_unmatched_org = attribute_table.skip_unmatched;
attribute_table.object_type = type;
+
+ // UI doesn't always know what are the possible attributes.
+ // In case of managed permissions, one of the possible lists is in ipapermdefaultattr.
+ var default_attrs = that.container.fields.get_field('ipapermdefaultattr');
+ if (default_attrs && default_attrs.enabled) { // if managed permission
+ attribute_table.custom_options = default_attrs.get_value();
+ } else {
+ attribute_table.custom_options = [];
+ }
+
// skip values which don't belong to new type. Bug #2617
attribute_table.skip_unmatched = skip_unmatched || skip_unmatched_org;
attribute_field.reset();