mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
aci association fixes
declarative priv definition fixes role_add_privilege and privilege_add_permisison
This commit is contained in:
parent
0dce1bc9e1
commit
f85771b2a7
@ -791,42 +791,33 @@ IPA.entity_factories.permission = function () {
|
|||||||
IPA.entity_factories.privilege = function() {
|
IPA.entity_factories.privilege = function() {
|
||||||
var that = IPA.entity({
|
var that = IPA.entity({
|
||||||
'name': 'privilege'
|
'name': 'privilege'
|
||||||
});
|
}).
|
||||||
that.init = function() {
|
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 search_facet = IPA.search_facet({
|
standard_associations();
|
||||||
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;
|
|
||||||
}());
|
|
||||||
|
|
||||||
|
|
||||||
var dialog = IPA.add_dialog({
|
|
||||||
name: 'add',
|
|
||||||
title: 'Add Privilege',
|
|
||||||
entity_name: that.entity
|
|
||||||
});
|
|
||||||
that.add_dialog(dialog);
|
|
||||||
|
|
||||||
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;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -851,6 +842,11 @@ IPA.entity_factories.role = function() {
|
|||||||
}).
|
}).
|
||||||
field(IPA.text_widget({ name: 'cn', undo: false})).
|
field(IPA.text_widget({ name: 'cn', undo: false})).
|
||||||
field(IPA.text_widget({ name: 'description', undo: false}))).
|
field(IPA.text_widget({ name: 'description', undo: false}))).
|
||||||
|
association({
|
||||||
|
name: 'privilege',
|
||||||
|
add_method: 'add_privilege',
|
||||||
|
remove_method: 'remove_privilege'
|
||||||
|
}).
|
||||||
standard_associations();
|
standard_associations();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -454,7 +454,8 @@ IPA.association_table_widget = function (spec) {
|
|||||||
'entity_name': that.entity_name,
|
'entity_name': that.entity_name,
|
||||||
'pkey': pkey,
|
'pkey': pkey,
|
||||||
'other_entity': that.other_entity,
|
'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,
|
'entity_name': that.entity_name,
|
||||||
'pkey': pkey,
|
'pkey': pkey,
|
||||||
'other_entity': that.other_entity,
|
'other_entity': that.other_entity,
|
||||||
'values': selected_values
|
'values': selected_values,
|
||||||
|
method:remove_method
|
||||||
});
|
});
|
||||||
|
|
||||||
dialog.remove = function() {
|
dialog.remove = function() {
|
||||||
|
@ -204,7 +204,14 @@ IPA.entity = function (spec) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (config){
|
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);
|
facet = IPA.association_facet(spec);
|
||||||
|
Loading…
Reference in New Issue
Block a user