2011-01-14 12:16:25 -05:00
|
|
|
/*jsl:import ipa.js */
|
|
|
|
|
|
2010-09-16 10:28:07 -04:00
|
|
|
/* Authors:
|
|
|
|
|
* Pavel Zuna <pzuna@redhat.com>
|
2011-01-19 21:10:18 -05:00
|
|
|
* Endi Dewata <edewata@redhat.com>
|
|
|
|
|
* Adam Young <ayoung@redhat.com>
|
2010-09-16 10:28:07 -04:00
|
|
|
*
|
|
|
|
|
* Copyright (C) 2010 Red Hat
|
|
|
|
|
* see file 'COPYING' for use and warranty information
|
|
|
|
|
*
|
2010-12-09 13:59:11 +01:00
|
|
|
* 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, either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
2010-09-16 10:28:07 -04:00
|
|
|
*
|
|
|
|
|
* 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
|
2010-12-09 13:59:11 +01:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2010-09-16 10:28:07 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */
|
|
|
|
|
|
2011-01-19 21:10:18 -05:00
|
|
|
IPA.entity_factories.group = function () {
|
2010-11-09 14:22:31 -06:00
|
|
|
|
2011-03-18 16:43:54 -04:00
|
|
|
return IPA.entity_builder().
|
|
|
|
|
entity('group').
|
|
|
|
|
search_facet({
|
2011-04-18 10:59:50 -05:00
|
|
|
columns:['cn','gidnumber','description']
|
2011-03-18 16:43:54 -04:00
|
|
|
}).
|
2011-03-31 15:32:29 -04:00
|
|
|
details_facet({sections:
|
2011-03-18 16:43:54 -04:00
|
|
|
[{
|
2011-03-31 15:32:29 -04:00
|
|
|
name:'details',
|
2011-03-18 16:43:54 -04:00
|
|
|
fields:['cn','description','gidnumber']
|
2011-03-31 15:32:29 -04:00
|
|
|
}]}).
|
2011-04-07 16:14:58 -05:00
|
|
|
association_facet({
|
|
|
|
|
name: 'member_user',
|
2011-03-18 16:43:54 -04:00
|
|
|
columns:[
|
|
|
|
|
{
|
|
|
|
|
name: 'uid',
|
|
|
|
|
primary_key: true,
|
2011-06-13 23:18:57 -05:00
|
|
|
link: true
|
2011-03-18 16:43:54 -04:00
|
|
|
},
|
|
|
|
|
{name: 'uidnumber'},
|
|
|
|
|
{name: 'mail'},
|
|
|
|
|
{name: 'telephonenumber'},
|
|
|
|
|
{name: 'title'}
|
|
|
|
|
],
|
|
|
|
|
adder_columns:[
|
|
|
|
|
{
|
|
|
|
|
name: 'cn',
|
|
|
|
|
width: '100px'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'uid',
|
|
|
|
|
primary_key: true,
|
|
|
|
|
width: '100px'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
2011-04-07 16:14:58 -05:00
|
|
|
}).
|
2011-03-18 16:43:54 -04:00
|
|
|
association_facet({
|
2011-05-13 20:05:35 -05:00
|
|
|
name: 'memberof_group',
|
|
|
|
|
associator: IPA.serial_associator
|
2011-03-18 16:43:54 -04:00
|
|
|
}).
|
|
|
|
|
association_facet({
|
|
|
|
|
name: 'memberof_netgroup',
|
|
|
|
|
associator: IPA.serial_associator
|
|
|
|
|
}).
|
|
|
|
|
association_facet({
|
|
|
|
|
name: 'memberof_role',
|
|
|
|
|
associator: IPA.serial_associator
|
|
|
|
|
}).
|
2011-07-06 10:03:04 -05:00
|
|
|
association_facet({
|
|
|
|
|
name: 'memberof_hbacrule',
|
|
|
|
|
associator: IPA.serial_associator,
|
|
|
|
|
add_method: 'add_user',
|
|
|
|
|
remove_method: 'remove_user'
|
|
|
|
|
}).
|
|
|
|
|
association_facet({
|
|
|
|
|
name: 'memberof_sudorule',
|
|
|
|
|
associator: IPA.serial_associator,
|
|
|
|
|
add_method: 'add_user',
|
|
|
|
|
remove_method: 'remove_user'
|
|
|
|
|
}).
|
2011-03-31 15:32:29 -04:00
|
|
|
standard_association_facets().
|
2011-04-18 10:59:50 -05:00
|
|
|
adder_dialog({
|
|
|
|
|
fields: [
|
|
|
|
|
'cn',
|
|
|
|
|
'description',
|
|
|
|
|
{
|
2011-09-14 12:36:58 -05:00
|
|
|
factory: IPA.group_nonposix_checkbox_widget,
|
|
|
|
|
name: 'nonposix',
|
2011-04-18 10:59:50 -05:00
|
|
|
label: IPA.messages.objects.group.posix,
|
2011-09-14 12:36:58 -05:00
|
|
|
checked: true
|
2011-04-18 10:59:50 -05:00
|
|
|
},
|
|
|
|
|
'gidnumber']
|
|
|
|
|
}).
|
2011-03-18 16:43:54 -04:00
|
|
|
build();
|
2011-01-14 12:16:25 -05:00
|
|
|
};
|
2011-09-14 12:36:58 -05:00
|
|
|
|
|
|
|
|
IPA.group_nonposix_checkbox_widget = function (spec) {
|
|
|
|
|
|
|
|
|
|
spec = spec || {};
|
|
|
|
|
|
|
|
|
|
var that = IPA.checkbox_widget(spec);
|
|
|
|
|
|
|
|
|
|
that.save = function() {
|
|
|
|
|
var value = that.checkbox_save()[0];
|
|
|
|
|
// convert posix into non-posix
|
|
|
|
|
return [!value];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return that;
|
|
|
|
|
};
|