diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2013-04-17 15:48:48 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2013-05-06 16:22:27 +0200 |
commit | bee39848d302a968fccecba7619ad1f9b71554bd (patch) | |
tree | 4c8d6064e9c913e05d4232e5f92c190324939f3b /install/ui/src/freeipa/entity.js | |
parent | 33b584f0a0d8b7da10490bdae3df4421b8a46660 (diff) | |
download | freeipa-bee39848d302a968fccecba7619ad1f9b71554bd.tar.gz freeipa-bee39848d302a968fccecba7619ad1f9b71554bd.tar.xz freeipa-bee39848d302a968fccecba7619ad1f9b71554bd.zip |
Make facet and entity policies declarative
https://fedorahosted.org/freeipa/ticket/3235
Diffstat (limited to 'install/ui/src/freeipa/entity.js')
-rw-r--r-- | install/ui/src/freeipa/entity.js | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/install/ui/src/freeipa/entity.js b/install/ui/src/freeipa/entity.js index 3e054467c..b002fd877 100644 --- a/install/ui/src/freeipa/entity.js +++ b/install/ui/src/freeipa/entity.js @@ -21,16 +21,22 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -define(['./ipa', './jquery', './text', './facets', './facet'], - function(IPA, $, text, facet_reg) { +define([ + './builder', + './ipa', + './jquery', + './text', + './facets', + './facet'], + function(builder, IPA, $, text, facet_reg) { IPA.entity = function(spec) { spec = spec || {}; spec.policies = spec.policies || [ - IPA.search_facet_update_policy(), - IPA.details_facet_update_policy() + IPA.search_facet_update_policy, + IPA.details_facet_update_policy ]; var that = IPA.object(); @@ -487,7 +493,9 @@ IPA.entity_policies = function(spec) { } }; - that.add_policies(spec.policies); + var policies = builder.build('', spec.policies, {}, + { $factory: IPA.entity_policy }) || []; + that.add_policies(policies); return that; }; |