From d2f2fc5addc0634b24ccda7a5aae1ed1d3c6001a Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Wed, 9 Jul 2014 16:49:46 +0200 Subject: 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 --- install/ui/src/freeipa/aci.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'install/ui/src/freeipa') 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(); -- cgit