From bee39848d302a968fccecba7619ad1f9b71554bd Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Wed, 17 Apr 2013 15:48:48 +0200 Subject: Make facet and entity policies declarative https://fedorahosted.org/freeipa/ticket/3235 --- install/ui/src/freeipa/aci.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'install/ui/src/freeipa/aci.js') diff --git a/install/ui/src/freeipa/aci.js b/install/ui/src/freeipa/aci.js index d7d952e5..c98edd16 100644 --- a/install/ui/src/freeipa/aci.js +++ b/install/ui/src/freeipa/aci.js @@ -132,7 +132,10 @@ IPA.aci.permission_entity = function(spec) { } ], policies: [ - IPA.permission_target_policy('target') + { + $factory: IPA.permission_target_policy, + widget_name: 'target' + } ] }). association_facet({ @@ -217,7 +220,10 @@ IPA.aci.permission_entity = function(spec) { } ], policies: [ - IPA.permission_target_policy('target') + { + $factory: IPA.permission_target_policy, + widget_name: 'target' + } ] }); }; @@ -740,13 +746,14 @@ IPA.permission_target_widget = function(spec) { return that; }; -IPA.permission_target_policy = function (widget_name) { +IPA.permission_target_policy = function (spec) { var that = IPA.facet_policy(); + that.widget_name = spec.widget_name; that.init = function() { - that.permission_target = that.container.widgets.get_widget(widget_name); + that.permission_target = that.container.widgets.get_widget(that.widget_name); var widgets = that.permission_target.widgets; var target_select = widgets.get_widget('target'); -- cgit