mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
The HBAC details page has been enhanced to support Undo and Reset operations. The functionality is implemented in the base widget class so the behavior will be more consistent across widgets. A <span> tag now used to define the field boundary in the HTML doc. The tag contains the visual representation of the field which include the input tag and optionally the undo link. The Update method on HBAC details page has been modified so that it executes several operations using a batch command. The operations being executed depends on the changes made to the fields. These operations may include: - removing access time if access time is changed to any time - removing memberships if member category is changed to all - modifying rule attributes if description or rule type is changed - enabling/disabling the rule if rule status is changed The behavior of the Add & Remove buttons also has been changed such that it adjust the category attribute properly in addition to adding the memberships using batch command. For example, if category is initially set to all, adding a new member will also change the category to empty. The ipa_command have been modified to store the on_success and on_error handlers as properties. When the command is executed as a part of batch operation, the result of each command will be passed to the appropriate handler. The unit tests and test data have been updated as well.
87 lines
2.4 KiB
JavaScript
87 lines
2.4 KiB
JavaScript
/* Authors:
|
|
* Pavel Zuna <pzuna@redhat.com>
|
|
*
|
|
* Copyright (C) 2010 Red Hat
|
|
* see file 'COPYING' for use and warranty information
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License as
|
|
* published by the Free Software Foundation; version 2 only
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*/
|
|
|
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
|
|
|
|
function ipa_group() {
|
|
|
|
var that = ipa_entity({
|
|
'name': 'group'
|
|
});
|
|
|
|
that.superior_init = that.superior('init');
|
|
|
|
that.init = function() {
|
|
|
|
var dialog = ipa_group_add_dialog({
|
|
'name': 'add',
|
|
'title': 'Add New Group'
|
|
});
|
|
that.add_dialog(dialog);
|
|
dialog.init();
|
|
|
|
that.superior_init();
|
|
};
|
|
|
|
return that;
|
|
}
|
|
|
|
IPA.add_entity(ipa_group());
|
|
|
|
function ipa_group_add_dialog(spec) {
|
|
|
|
spec = spec || {};
|
|
|
|
var that = ipa_add_dialog(spec);
|
|
|
|
that.superior_init = that.superior('init');
|
|
|
|
that.init = function() {
|
|
|
|
this.superior_init();
|
|
|
|
this.add_field(ipa_text_widget({name:'cn', label:'Name', undo: false}));
|
|
this.add_field(ipa_text_widget({name:'description', label:'Description', undo: false}));
|
|
this.add_field(ipa_checkbox_widget({name:'posix', label:'Is this a POSIX group?', undo: false}));
|
|
this.add_field(ipa_text_widget({name:'gidnumber', label:'GID', undo: false}));
|
|
};
|
|
|
|
return that;
|
|
}
|
|
|
|
ipa_entity_set_search_definition('group', [
|
|
['cn', 'Name', null],
|
|
['gidnumber', 'GID', null],
|
|
['description', 'Description', null]
|
|
]);
|
|
|
|
ipa_entity_set_details_definition('group',[
|
|
ipa_stanza({name:'identity', label:'Group Details'}).
|
|
input({name:'cn', label:'Group Name'}).
|
|
input({name:'description', label:'Description'}).
|
|
input({name:'gidnumber', label:'Group ID'})
|
|
]);
|
|
|
|
ipa_entity_set_association_definition('group', {
|
|
'netgroup': { associator: 'serial' },
|
|
'rolegroup': { associator: 'serial' },
|
|
'taskgroup': { associator: 'serial' }
|
|
});
|