mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Make group external
New action for creating plain group external. Posix group can't be made external. https://fedorahosted.org/freeipa/ticket/2895
This commit is contained in:
parent
44e86aa3bb
commit
271043ccf7
@ -1068,6 +1068,33 @@ IPA.value_state_evaluator = function(spec) {
|
|||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
IPA.object_class_evaluator = function(spec) {
|
||||||
|
|
||||||
|
spec.name = spec.name || 'object_class_evaluator';
|
||||||
|
spec.event = spec.event || 'post_load';
|
||||||
|
|
||||||
|
var that = IPA.state_evaluator(spec);
|
||||||
|
|
||||||
|
|
||||||
|
that.on_event = function(data) {
|
||||||
|
|
||||||
|
var old_state, classes, i;
|
||||||
|
|
||||||
|
old_state = that.state;
|
||||||
|
classes = data.result.result.objectclass;
|
||||||
|
|
||||||
|
that.state = [];
|
||||||
|
|
||||||
|
for (i=0; i<classes.length; i++) {
|
||||||
|
that.state.push('oc_'+classes[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
that.notify_on_change(old_state);
|
||||||
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
|
};
|
||||||
|
|
||||||
IPA.object_action = function(spec) {
|
IPA.object_action = function(spec) {
|
||||||
|
|
||||||
spec = spec || {};
|
spec = spec || {};
|
||||||
@ -1076,6 +1103,7 @@ IPA.object_action = function(spec) {
|
|||||||
|
|
||||||
that.method = spec.method;
|
that.method = spec.method;
|
||||||
that.confirm_msg = spec.confirm_msg || IPA.messages.actions.confirm;
|
that.confirm_msg = spec.confirm_msg || IPA.messages.actions.confirm;
|
||||||
|
that.options = spec.options || {};
|
||||||
|
|
||||||
that.execute_action = function(facet, on_success, on_error) {
|
that.execute_action = function(facet, on_success, on_error) {
|
||||||
|
|
||||||
@ -1088,6 +1116,7 @@ IPA.object_action = function(spec) {
|
|||||||
entity: entity_name,
|
entity: entity_name,
|
||||||
method: that.method,
|
method: that.method,
|
||||||
args: [pkey],
|
args: [pkey],
|
||||||
|
options: that.options,
|
||||||
on_success: that.get_on_success(facet, on_success),
|
on_success: that.get_on_success(facet, on_success),
|
||||||
on_error: that.get_on_error(facet, on_error)
|
on_error: that.get_on_error(facet, on_error)
|
||||||
}).execute();
|
}).execute();
|
||||||
|
@ -53,7 +53,18 @@ IPA.group.entity = function(spec) {
|
|||||||
'gidnumber'
|
'gidnumber'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
actions: [
|
||||||
|
IPA.select_action,
|
||||||
|
IPA.group.make_external_action,
|
||||||
|
IPA.delete_action
|
||||||
|
],
|
||||||
|
header_actions: ['select_action', 'make_external', 'delete'],
|
||||||
|
state: {
|
||||||
|
evaluators: [
|
||||||
|
IPA.object_class_evaluator
|
||||||
|
]
|
||||||
|
}
|
||||||
}).
|
}).
|
||||||
association_facet({
|
association_facet({
|
||||||
name: 'member_user',
|
name: 'member_user',
|
||||||
@ -186,4 +197,20 @@ IPA.group_adder_dialog = function(spec) {
|
|||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
IPA.group.make_external_action = function(spec) {
|
||||||
|
|
||||||
|
spec = spec || {};
|
||||||
|
spec.name = spec.name || 'make_external';
|
||||||
|
spec.method = spec.method || 'mod';
|
||||||
|
spec.label = spec.label || IPA.messages.objects.group.make_external;
|
||||||
|
spec.disable_cond = spec.disable_cond || ['oc_posixgroup','oc_ipaexternalgroup'];
|
||||||
|
spec.options = spec.options || {
|
||||||
|
external: true
|
||||||
|
};
|
||||||
|
|
||||||
|
var that = IPA.object_action(spec);
|
||||||
|
|
||||||
|
return that;
|
||||||
|
};
|
||||||
|
|
||||||
IPA.register('group', IPA.group.entity);
|
IPA.register('group', IPA.group.entity);
|
||||||
|
@ -264,6 +264,14 @@
|
|||||||
],
|
],
|
||||||
"memberof_group": [
|
"memberof_group": [
|
||||||
"editors"
|
"editors"
|
||||||
|
],
|
||||||
|
"objectclass": [
|
||||||
|
"top",
|
||||||
|
"groupofnames",
|
||||||
|
"nestedgroup",
|
||||||
|
"ipausergroup",
|
||||||
|
"ipaobject",
|
||||||
|
"posixgroup"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"summary": null,
|
"summary": null,
|
||||||
|
@ -269,6 +269,7 @@
|
|||||||
"group": {
|
"group": {
|
||||||
"details": "Group Settings",
|
"details": "Group Settings",
|
||||||
"external": "External",
|
"external": "External",
|
||||||
|
"make_external": "Change to external group",
|
||||||
"normal": "Normal",
|
"normal": "Normal",
|
||||||
"posix": "POSIX",
|
"posix": "POSIX",
|
||||||
"type": "Group Type"
|
"type": "Group Type"
|
||||||
|
@ -406,6 +406,7 @@ class i18n_messages(Command):
|
|||||||
"group": {
|
"group": {
|
||||||
"details": _("Group Settings"),
|
"details": _("Group Settings"),
|
||||||
"external": _("External"),
|
"external": _("External"),
|
||||||
|
"make_external": _("Change to external group"),
|
||||||
"normal": _("Normal"),
|
"normal": _("Normal"),
|
||||||
"posix": _("POSIX"),
|
"posix": _("POSIX"),
|
||||||
"type": _("Group Type"),
|
"type": _("Group Type"),
|
||||||
|
Loading…
Reference in New Issue
Block a user