mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fixed sudo rule association dialogs.
The adder dialog for the user and host tables in sudo rule details page have been fixed to use --not-in-sudorules to avoid showing entries that are already added into the rule either directly or indirectly via groups. This does not apply to the command and run-as tables because they do not support such option. Ticket #1768
This commit is contained in:
parent
26ded75be9
commit
a95b44face
@ -493,13 +493,15 @@ IPA.association_table_widget = function (spec) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
that.create_add_dialog = function() {
|
that.create_add_dialog = function() {
|
||||||
|
|
||||||
|
var entity_label = that.entity.metadata.label_singular;
|
||||||
var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
|
var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
|
||||||
var label = IPA.metadata.objects[that.other_entity].label;
|
var other_entity_label = IPA.metadata.objects[that.other_entity].label;
|
||||||
|
|
||||||
var title = that.add_title;
|
var title = that.add_title;
|
||||||
title = title.replace('${entity}', that.entity.metadata.label_singular);
|
title = title.replace('${entity}', entity_label);
|
||||||
title = title.replace('${primary_key}', pkey);
|
title = title.replace('${primary_key}', pkey);
|
||||||
title = title.replace('${other_entity}', label);
|
title = title.replace('${other_entity}', other_entity_label);
|
||||||
|
|
||||||
return IPA.association_adder_dialog({
|
return IPA.association_adder_dialog({
|
||||||
title: title,
|
title: title,
|
||||||
|
@ -1042,18 +1042,21 @@ IPA.sudorule_association_table_widget = function(spec) {
|
|||||||
|
|
||||||
that.create_add_dialog = function() {
|
that.create_add_dialog = function() {
|
||||||
|
|
||||||
|
var entity_label = that.entity.metadata.label_singular;
|
||||||
var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
|
var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
|
||||||
|
var other_entity_label = IPA.metadata.objects[that.other_entity].label;
|
||||||
|
|
||||||
var title = that.add_title;
|
var title = that.add_title;
|
||||||
title = title.replace('${other_entity}', IPA.metadata.objects[that.other_entity].label);
|
title = title.replace('${entity}', entity_label);
|
||||||
title = title.replace('${entity}', IPA.metadata.objects[that.entity.name].label_singular);
|
|
||||||
title = title.replace('${primary_key}', pkey);
|
title = title.replace('${primary_key}', pkey);
|
||||||
|
title = title.replace('${other_entity}', other_entity_label);
|
||||||
|
|
||||||
return IPA.sudo.rule_association_adder_dialog({
|
return IPA.sudo.rule_association_adder_dialog({
|
||||||
title: title,
|
title: title,
|
||||||
pkey: pkey,
|
pkey: pkey,
|
||||||
other_entity: that.other_entity,
|
other_entity: that.other_entity,
|
||||||
entity:that.entity,
|
attribute_member: that.attribute_member,
|
||||||
|
entity: that.entity,
|
||||||
external: that.external
|
external: that.external
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -1085,7 +1088,7 @@ IPA.sudo.rule_association_adder_dialog = function(spec) {
|
|||||||
if (!that.columns.length) {
|
if (!that.columns.length) {
|
||||||
var pkey_name = IPA.metadata.objects[that.other_entity].primary_key;
|
var pkey_name = IPA.metadata.objects[that.other_entity].primary_key;
|
||||||
that.create_column({
|
that.create_column({
|
||||||
entity:that.entity,
|
entity: that.entity,
|
||||||
name: pkey_name,
|
name: pkey_name,
|
||||||
label: IPA.metadata.objects[that.other_entity].label,
|
label: IPA.metadata.objects[that.other_entity].label,
|
||||||
primary_key: true,
|
primary_key: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user