mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Make summary conditions declarative
https://fedorahosted.org/freeipa/ticket/3235
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
/* IPA Object Details - populating definiton lists from entry data */
|
/* IPA Object Details - populating definiton lists from entry data */
|
||||||
|
|
||||||
define([
|
define([
|
||||||
|
'dojo/_base/lang',
|
||||||
'./builder',
|
'./builder',
|
||||||
'./ipa',
|
'./ipa',
|
||||||
'./jquery',
|
'./jquery',
|
||||||
@@ -32,7 +33,7 @@ define([
|
|||||||
'./text',
|
'./text',
|
||||||
'./facet',
|
'./facet',
|
||||||
'./add'],
|
'./add'],
|
||||||
function(builder, IPA, $, phases, reg, text) {
|
function(lang, builder, IPA, $, phases, reg, text) {
|
||||||
|
|
||||||
var exp = {};
|
var exp = {};
|
||||||
|
|
||||||
@@ -1194,21 +1195,26 @@ exp.delete_action = IPA.delete_action = function(spec) {
|
|||||||
|
|
||||||
|
|
||||||
exp.enabled_summary_cond = IPA.enabled_summary_cond = function() {
|
exp.enabled_summary_cond = IPA.enabled_summary_cond = function() {
|
||||||
return {
|
|
||||||
|
var that = IPA.object();
|
||||||
|
lang.mixin(that, {
|
||||||
pos: ['enabled'],
|
pos: ['enabled'],
|
||||||
neg: [],
|
neg: [],
|
||||||
description: text.get('@i18n:status.enabled'),
|
description: text.get('@i18n:status.enabled'),
|
||||||
state: ['enabled']
|
state: ['enabled']
|
||||||
};
|
});
|
||||||
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
exp.disabled_summary_cond = IPA.disabled_summary_cond = function() {
|
exp.disabled_summary_cond = IPA.disabled_summary_cond = function() {
|
||||||
return {
|
var that = IPA.object();
|
||||||
|
lang.mixin(that, {
|
||||||
pos: [],
|
pos: [],
|
||||||
neg: ['enabled'],
|
neg: ['enabled'],
|
||||||
description: text.get('@i18n:status.disabled'),
|
description: text.get('@i18n:status.disabled'),
|
||||||
state: ['disabled']
|
state: ['disabled']
|
||||||
};
|
});
|
||||||
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
exp.register = function() {
|
exp.register = function() {
|
||||||
|
|||||||
@@ -255,8 +255,8 @@ IPA.dns.zone_entity = function(spec) {
|
|||||||
IPA.dns.zone_has_permission_evaluator
|
IPA.dns.zone_has_permission_evaluator
|
||||||
],
|
],
|
||||||
summary_conditions: [
|
summary_conditions: [
|
||||||
IPA.enabled_summary_cond(),
|
IPA.enabled_summary_cond,
|
||||||
IPA.disabled_summary_cond()
|
IPA.disabled_summary_cond
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}).
|
}).
|
||||||
|
|||||||
@@ -1787,7 +1787,7 @@ exp.state = IPA.state = function(spec) {
|
|||||||
that.evaluators = builder.build('state_evaluator', spec.evaluators) || [];
|
that.evaluators = builder.build('state_evaluator', spec.evaluators) || [];
|
||||||
that.summary_evaluator = builder.build('', spec.summary_evaluator || IPA.summary_evaluator);
|
that.summary_evaluator = builder.build('', spec.summary_evaluator || IPA.summary_evaluator);
|
||||||
|
|
||||||
that.summary_conditions = spec.summary_conditions || [];
|
that.summary_conditions = builder.build('', spec.summary_conditions) || [];
|
||||||
|
|
||||||
that.init = function(facet) {
|
that.init = function(facet) {
|
||||||
|
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ IPA.hbac.rule_entity = function(spec) {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
summary_conditions: [
|
summary_conditions: [
|
||||||
IPA.enabled_summary_cond(),
|
IPA.enabled_summary_cond,
|
||||||
IPA.disabled_summary_cond()
|
IPA.disabled_summary_cond
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}).
|
}).
|
||||||
|
|||||||
@@ -81,8 +81,8 @@ IPA.selinux.selinuxusermap_entity = function(spec) {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
summary_conditions: [
|
summary_conditions: [
|
||||||
IPA.enabled_summary_cond(),
|
IPA.enabled_summary_cond,
|
||||||
IPA.disabled_summary_cond()
|
IPA.disabled_summary_cond
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}).
|
}).
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ IPA.sudo.rule_entity = function(spec) {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
summary_conditions: [
|
summary_conditions: [
|
||||||
IPA.enabled_summary_cond(),
|
IPA.enabled_summary_cond,
|
||||||
IPA.disabled_summary_cond()
|
IPA.disabled_summary_cond
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}).
|
}).
|
||||||
|
|||||||
@@ -251,8 +251,8 @@ IPA.user.entity = function(spec) {
|
|||||||
IPA.user.reset_password_acl_evaluator
|
IPA.user.reset_password_acl_evaluator
|
||||||
],
|
],
|
||||||
summary_conditions: [
|
summary_conditions: [
|
||||||
IPA.enabled_summary_cond(),
|
IPA.enabled_summary_cond,
|
||||||
IPA.disabled_summary_cond()
|
IPA.disabled_summary_cond
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}).
|
}).
|
||||||
|
|||||||
Reference in New Issue
Block a user