summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2011-01-31 17:24:42 -0500
committerEndi S. Dewata <edewata@redhat.com>2011-01-31 23:09:13 -0500
commitf85771b2a7117c8870d800ee863ccf10fe0b13c3 (patch)
tree61dee76e0abf1fa65c1c7e2249e2a16c3ab06b28
parent0dce1bc9e13d54f223b45d44e9a2108c995cd455 (diff)
downloadfreeipa.git-f85771b2a7117c8870d800ee863ccf10fe0b13c3.tar.gz
freeipa.git-f85771b2a7117c8870d800ee863ccf10fe0b13c3.tar.xz
freeipa.git-f85771b2a7117c8870d800ee863ccf10fe0b13c3.zip
aci association fixes
declarative priv definition fixes role_add_privilege and privilege_add_permisison
-rw-r--r--install/ui/aci.js62
-rw-r--r--install/ui/associate.js6
-rw-r--r--install/ui/entity.js9
3 files changed, 41 insertions, 36 deletions
diff --git a/install/ui/aci.js b/install/ui/aci.js
index ffe264d8..d0150c80 100644
--- a/install/ui/aci.js
+++ b/install/ui/aci.js
@@ -791,42 +791,33 @@ IPA.entity_factories.permission = function () {
IPA.entity_factories.privilege = function() {
var that = IPA.entity({
'name': 'privilege'
- });
- that.init = function() {
-
- var search_facet = IPA.search_facet({
- name: 'search',
- label: 'Search',
- entity_name: that.name
- });
- search_facet.create_column({name:'cn'});
- search_facet.create_column({name:'description'});
- that.add_facet(search_facet);
-
- that.add_facet(function() {
- var that = IPA.details_facet({name:'details'});
- that.add_section(
- IPA.stanza({name:'identity', label:'Privilege Settings'}).
- input({name:'cn'}).
- input({name: 'description'}));
- return that;
- }());
-
+ }).
+ facet(
+ IPA.search_facet().
+ column({name:'cn'}).
+ column({name:'description'})).
+ facet(
+ IPA.details_facet({name:'details'}).
+ section(
+ IPA.stanza({name:'identity', label:'Privilege Settings'}).
+ input({name:'cn'}).
+ input({name: 'description'}))).
+ add_dialog(
+ IPA.add_dialog({
+ name: 'add',
+ title: 'Add Privilege'}).
+ field(IPA.text_widget({ name: 'cn', undo: false})).
+ field(IPA.text_widget({ name: 'description', undo: false}))).
+ association({
+ name: 'permission',
+ other_entity: 'privilege',
+ add_method: 'add_permission',
+ remove_method: 'remove_permission'
+ }).
- var dialog = IPA.add_dialog({
- name: 'add',
- title: 'Add Privilege',
- entity_name: that.entity
- });
- that.add_dialog(dialog);
+ standard_associations();
- dialog.add_field(IPA.text_widget({ name: 'cn', undo: false}));
- dialog.add_field(IPA.text_widget({ name: 'description', undo: false}));
- dialog.init();
- that.create_association_facets();
- that.entity_init();
- };
return that;
};
@@ -851,6 +842,11 @@ IPA.entity_factories.role = function() {
}).
field(IPA.text_widget({ name: 'cn', undo: false})).
field(IPA.text_widget({ name: 'description', undo: false}))).
+ association({
+ name: 'privilege',
+ add_method: 'add_privilege',
+ remove_method: 'remove_privilege'
+ }).
standard_associations();
};
diff --git a/install/ui/associate.js b/install/ui/associate.js
index bdb10337..15fe8fed 100644
--- a/install/ui/associate.js
+++ b/install/ui/associate.js
@@ -454,7 +454,8 @@ IPA.association_table_widget = function (spec) {
'entity_name': that.entity_name,
'pkey': pkey,
'other_entity': that.other_entity,
- 'attribute_member': that.attribute_member
+ 'attribute_member': that.attribute_member,
+ method:that.add_method
});
};
@@ -518,7 +519,8 @@ IPA.association_table_widget = function (spec) {
'entity_name': that.entity_name,
'pkey': pkey,
'other_entity': that.other_entity,
- 'values': selected_values
+ 'values': selected_values,
+ method:remove_method
});
dialog.remove = function() {
diff --git a/install/ui/entity.js b/install/ui/entity.js
index 82af8234..4a8971d3 100644
--- a/install/ui/entity.js
+++ b/install/ui/entity.js
@@ -204,7 +204,14 @@ IPA.entity = function (spec) {
};
if (config){
- spec.associator = config.associator;
+ for (var key in config){
+ /*name is special, as iut has already been munged
+ into the association name */
+ if (key === "name"){
+ continue;
+ }
+ spec[key] = config[key] ;
+ }
}
facet = IPA.association_facet(spec);