2011-01-14 12:16:25 -05:00
|
|
|
/*jsl:import ipa.js */
|
|
|
|
|
|
2010-11-18 20:17:14 -06:00
|
|
|
/* Authors:
|
|
|
|
|
* Endi Sukma Dewata <edewata@redhat.com>
|
|
|
|
|
*
|
|
|
|
|
* 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-11-18 20:17:14 -06: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-11-18 20:17:14 -06:00
|
|
|
*/
|
|
|
|
|
|
2011-11-02 12:21:39 -05:00
|
|
|
/* REQUIRES: ipa.js, details.js, search.js, add.js, facet.js, entity.js */
|
2010-11-18 20:17:14 -06:00
|
|
|
|
2011-11-29 13:36:07 +01:00
|
|
|
IPA.sudo = {
|
|
|
|
|
//priority of commands in details facet
|
|
|
|
|
remove_method_priority: IPA.config.default_priority - 1,
|
|
|
|
|
enable_priority: IPA.config.default_priority + 1
|
|
|
|
|
};
|
2011-11-02 14:07:07 -05:00
|
|
|
|
|
|
|
|
IPA.sudo.rule_entity = function(spec) {
|
2011-02-16 14:26:35 +01:00
|
|
|
|
2011-11-02 14:07:07 -05:00
|
|
|
var that = IPA.entity(spec);
|
2010-11-18 20:17:14 -06:00
|
|
|
|
2011-11-16 21:07:20 -06:00
|
|
|
that.init = function() {
|
|
|
|
|
that.entity_init();
|
2011-11-02 14:07:07 -05:00
|
|
|
|
2011-11-16 21:07:20 -06:00
|
|
|
that.builder.search_facet({
|
2011-09-16 10:32:28 -05:00
|
|
|
columns: [
|
|
|
|
|
'cn',
|
2011-12-05 16:23:38 +01:00
|
|
|
{
|
|
|
|
|
name: 'ipaenabledflag',
|
|
|
|
|
format: IPA.boolean_format
|
|
|
|
|
},
|
2011-09-16 10:32:28 -05:00
|
|
|
'description'
|
|
|
|
|
]
|
2011-03-18 16:43:54 -04:00
|
|
|
}).
|
2011-05-16 14:40:09 -05:00
|
|
|
details_facet({
|
2011-11-29 13:36:07 +01:00
|
|
|
factory: IPA.sudorule_details_facet,
|
|
|
|
|
entity: that,
|
|
|
|
|
command_mode: 'info'
|
2011-04-07 16:14:58 -05:00
|
|
|
}).
|
2011-04-18 10:59:50 -05:00
|
|
|
adder_dialog({
|
2011-09-16 10:32:28 -05:00
|
|
|
fields: [ 'cn' ]
|
2011-11-02 14:07:07 -05:00
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return that;
|
2011-03-18 16:43:54 -04:00
|
|
|
};
|
2010-11-18 20:17:14 -06:00
|
|
|
|
2011-11-02 14:07:07 -05:00
|
|
|
IPA.sudo.command_entity = function(spec) {
|
|
|
|
|
|
|
|
|
|
var that = IPA.entity(spec);
|
|
|
|
|
|
2011-11-16 21:07:20 -06:00
|
|
|
that.init = function() {
|
|
|
|
|
that.entity_init();
|
2011-03-18 16:43:54 -04:00
|
|
|
|
2011-11-16 21:07:20 -06:00
|
|
|
that.builder.search_facet({
|
2011-09-16 18:21:41 -05:00
|
|
|
columns: [
|
|
|
|
|
'sudocmd',
|
|
|
|
|
'description'
|
|
|
|
|
]
|
|
|
|
|
}).
|
|
|
|
|
details_facet({
|
|
|
|
|
sections: [
|
|
|
|
|
{
|
|
|
|
|
name: 'general',
|
|
|
|
|
label: IPA.messages.details.general,
|
|
|
|
|
fields: [
|
|
|
|
|
'sudocmd',
|
|
|
|
|
{
|
2011-11-29 13:36:07 +01:00
|
|
|
type: 'textarea',
|
2011-09-16 18:21:41 -05:00
|
|
|
name: 'description'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}).
|
2011-07-28 17:23:41 -05:00
|
|
|
association_facet({
|
|
|
|
|
name: 'memberof_sudocmdgroup',
|
|
|
|
|
associator: IPA.serial_associator,
|
|
|
|
|
columns:[
|
2011-11-18 19:47:39 -06:00
|
|
|
'cn',
|
|
|
|
|
'description'
|
2011-07-28 17:23:41 -05:00
|
|
|
],
|
2011-09-16 18:21:41 -05:00
|
|
|
adder_columns: [
|
2011-07-28 17:23:41 -05:00
|
|
|
{
|
|
|
|
|
name: 'cn',
|
|
|
|
|
primary_key: true,
|
|
|
|
|
width: '100px'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'description',
|
|
|
|
|
width: '100px'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}).
|
|
|
|
|
standard_association_facets().
|
2011-04-18 10:59:50 -05:00
|
|
|
adder_dialog({
|
2011-09-16 18:21:41 -05:00
|
|
|
fields: [
|
|
|
|
|
'sudocmd',
|
|
|
|
|
{
|
2011-11-29 13:36:07 +01:00
|
|
|
type: 'textarea',
|
2011-09-16 18:21:41 -05:00
|
|
|
name: 'description'
|
|
|
|
|
}
|
|
|
|
|
]
|
2011-11-02 14:07:07 -05:00
|
|
|
});
|
|
|
|
|
};
|
2010-11-18 20:17:14 -06:00
|
|
|
|
2011-11-02 14:07:07 -05:00
|
|
|
return that;
|
2011-03-18 16:43:54 -04:00
|
|
|
};
|
2011-02-08 15:41:24 -06:00
|
|
|
|
2011-11-02 14:07:07 -05:00
|
|
|
IPA.sudo.command_group_entity = function(spec) {
|
|
|
|
|
|
|
|
|
|
var that = IPA.entity(spec);
|
|
|
|
|
|
2011-11-16 21:07:20 -06:00
|
|
|
that.init = function() {
|
|
|
|
|
that.entity_init();
|
2011-11-02 14:07:07 -05:00
|
|
|
|
2011-11-16 21:07:20 -06:00
|
|
|
that.builder.search_facet({
|
2011-09-16 18:21:41 -05:00
|
|
|
columns: [
|
|
|
|
|
'cn',
|
|
|
|
|
'description'
|
|
|
|
|
]
|
|
|
|
|
}).
|
|
|
|
|
details_facet({
|
|
|
|
|
sections: [
|
|
|
|
|
{
|
|
|
|
|
name: 'general',
|
|
|
|
|
label: IPA.messages.details.general,
|
|
|
|
|
fields: [
|
|
|
|
|
'cn',
|
|
|
|
|
{
|
2011-11-29 13:36:07 +01:00
|
|
|
type: 'textarea',
|
2011-09-16 18:21:41 -05:00
|
|
|
name: 'description'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
]
|
2011-03-18 16:43:54 -04:00
|
|
|
}).
|
2011-07-28 17:23:41 -05:00
|
|
|
association_facet({
|
|
|
|
|
name: 'member_sudocmd',
|
2011-09-16 18:21:41 -05:00
|
|
|
columns: [
|
2011-11-18 19:47:39 -06:00
|
|
|
'sudocmd',
|
|
|
|
|
'description'
|
2011-07-28 17:23:41 -05:00
|
|
|
],
|
|
|
|
|
adder_columns: [
|
|
|
|
|
{
|
|
|
|
|
name: 'sudocmd',
|
|
|
|
|
primary_key: true,
|
|
|
|
|
width: '100px'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'description',
|
|
|
|
|
width: '100px'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}).
|
|
|
|
|
standard_association_facets().
|
2011-04-18 10:59:50 -05:00
|
|
|
adder_dialog({
|
2011-09-16 18:21:41 -05:00
|
|
|
fields: [
|
|
|
|
|
'cn',
|
|
|
|
|
{
|
2011-11-29 13:36:07 +01:00
|
|
|
type: 'textarea',
|
2011-09-16 18:21:41 -05:00
|
|
|
name: 'description'
|
|
|
|
|
}
|
|
|
|
|
]
|
2011-11-02 14:07:07 -05:00
|
|
|
});
|
|
|
|
|
};
|
2010-11-18 20:17:14 -06:00
|
|
|
|
2011-11-02 14:07:07 -05:00
|
|
|
return that;
|
|
|
|
|
};
|
2011-03-18 16:43:54 -04:00
|
|
|
|
2011-07-07 15:42:57 -04:00
|
|
|
IPA.sudorule_details_facet = function(spec) {
|
2010-11-18 20:17:14 -06:00
|
|
|
|
2011-11-29 13:36:07 +01:00
|
|
|
var entity_name = spec.entity.name;
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// General
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
spec.fields = [
|
|
|
|
|
{
|
|
|
|
|
name: 'cn',
|
|
|
|
|
read_only: true,
|
|
|
|
|
widget: 'general.cn'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'textarea',
|
|
|
|
|
name: 'description',
|
|
|
|
|
widget: 'general.description'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'enable',
|
|
|
|
|
name: 'ipaenabledflag',
|
|
|
|
|
priority: IPA.sudo.enable_priority,
|
|
|
|
|
widget: 'general.ipaenabledflag'
|
|
|
|
|
}
|
|
|
|
|
];
|
2010-11-18 20:17:14 -06:00
|
|
|
|
2011-11-29 13:36:07 +01:00
|
|
|
spec.widgets = [
|
|
|
|
|
{
|
|
|
|
|
type: 'details_table_section',
|
removing setters setup and init
change widget and widget unit tests to hold on to entity, not entity name.
Replacing entity_name with entity.name in most places.
The one exception is columns for table_widget.
Widgets that refer to other entities have to have late resolution of the entity object, due to circular dependencies.
cleanup entity assignment.
removed template and layout,
merged setup into create
adder dialogs adjust height for external
removed init from widget, isection, association, facet, host and service
Make unit tests use factory.
fix functional tests to click find link correctly.
tweak to activation test, but still broken.
moved initialization code to the end
use --all for hbacrule find, so the type shows up now
fixed dns exception code and exception handling for get_entity
replace metadata look up with value from entity.
fixed author lines
removed duplicate columns in managed by facets.
tweak to nav fix in order to initialize tab.
more defensive code
update metadata for true false
one line init for entity_name in widget
move init code to end of constructor functions
moved constants to start of function for adder_dialog
external fields for dialogs initialized at dialog creation
sudo sections: move add fields and columns to widget definition.
The parameter validation in IPA.column ...This is precondition checking. Note that it merely throws an exception if the entity_name is not set. I want this stuff at the top of the function so that it is obvious to people looking to use them what is required. I added a comment to make this clear, but I'd like to keep precondition checking at the top of the function.
decreased the scope of the pkey_name and moved the initiailzation fof columns into the setup_column function for association_tables
return false at the end of click handler
removed blank labels in sudo command section
fix radio buttons for sudo category
fixed table side for adder dialogs with external fields
comments for future direction with add_columns
https://fedorahosted.org/freeipa/ticket/1451
https://fedorahosted.org/freeipa/ticket/1462
https://fedorahosted.org/freeipa/ticket/1493
https://fedorahosted.org/freeipa/ticket/1497
https://fedorahosted.org/freeipa/ticket/1532
https://fedorahosted.org/freeipa/ticket/1534
2011-07-25 12:15:14 -04:00
|
|
|
name: 'general',
|
|
|
|
|
label: IPA.messages.details.general,
|
2011-11-29 13:36:07 +01:00
|
|
|
widgets: [
|
|
|
|
|
{
|
|
|
|
|
name: 'cn'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'textarea',
|
|
|
|
|
name: 'description'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'enable',
|
|
|
|
|
name: 'ipaenabledflag',
|
|
|
|
|
options: [
|
|
|
|
|
{ value: 'TRUE', label: IPA.get_message('true') },
|
|
|
|
|
{ value: 'FALSE', label: IPA.get_message('false') }
|
|
|
|
|
]
|
|
|
|
|
}
|
2011-09-16 10:32:28 -05:00
|
|
|
]
|
2011-11-29 13:36:07 +01:00
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Options
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
spec.fields.push.apply(spec.fields, [
|
|
|
|
|
{
|
|
|
|
|
name: 'ipasudoopt',
|
|
|
|
|
widget: 'options.ipasudoopt'
|
|
|
|
|
}
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
spec.widgets.push.apply(spec.widgets, [
|
|
|
|
|
{
|
|
|
|
|
factory: IPA.sudo.options_section,
|
|
|
|
|
name: 'options',
|
|
|
|
|
label: IPA.messages.objects.sudorule.options,
|
|
|
|
|
facet: that
|
|
|
|
|
}
|
|
|
|
|
]);
|
removing setters setup and init
change widget and widget unit tests to hold on to entity, not entity name.
Replacing entity_name with entity.name in most places.
The one exception is columns for table_widget.
Widgets that refer to other entities have to have late resolution of the entity object, due to circular dependencies.
cleanup entity assignment.
removed template and layout,
merged setup into create
adder dialogs adjust height for external
removed init from widget, isection, association, facet, host and service
Make unit tests use factory.
fix functional tests to click find link correctly.
tweak to activation test, but still broken.
moved initialization code to the end
use --all for hbacrule find, so the type shows up now
fixed dns exception code and exception handling for get_entity
replace metadata look up with value from entity.
fixed author lines
removed duplicate columns in managed by facets.
tweak to nav fix in order to initialize tab.
more defensive code
update metadata for true false
one line init for entity_name in widget
move init code to end of constructor functions
moved constants to start of function for adder_dialog
external fields for dialogs initialized at dialog creation
sudo sections: move add fields and columns to widget definition.
The parameter validation in IPA.column ...This is precondition checking. Note that it merely throws an exception if the entity_name is not set. I want this stuff at the top of the function so that it is obvious to people looking to use them what is required. I added a comment to make this clear, but I'd like to keep precondition checking at the top of the function.
decreased the scope of the pkey_name and moved the initiailzation fof columns into the setup_column function for association_tables
return false at the end of click handler
removed blank labels in sudo command section
fix radio buttons for sudo category
fixed table side for adder dialogs with external fields
comments for future direction with add_columns
https://fedorahosted.org/freeipa/ticket/1451
https://fedorahosted.org/freeipa/ticket/1462
https://fedorahosted.org/freeipa/ticket/1493
https://fedorahosted.org/freeipa/ticket/1497
https://fedorahosted.org/freeipa/ticket/1532
https://fedorahosted.org/freeipa/ticket/1534
2011-07-25 12:15:14 -04:00
|
|
|
|
2011-11-29 13:36:07 +01:00
|
|
|
/*
|
removing setters setup and init
change widget and widget unit tests to hold on to entity, not entity name.
Replacing entity_name with entity.name in most places.
The one exception is columns for table_widget.
Widgets that refer to other entities have to have late resolution of the entity object, due to circular dependencies.
cleanup entity assignment.
removed template and layout,
merged setup into create
adder dialogs adjust height for external
removed init from widget, isection, association, facet, host and service
Make unit tests use factory.
fix functional tests to click find link correctly.
tweak to activation test, but still broken.
moved initialization code to the end
use --all for hbacrule find, so the type shows up now
fixed dns exception code and exception handling for get_entity
replace metadata look up with value from entity.
fixed author lines
removed duplicate columns in managed by facets.
tweak to nav fix in order to initialize tab.
more defensive code
update metadata for true false
one line init for entity_name in widget
move init code to end of constructor functions
moved constants to start of function for adder_dialog
external fields for dialogs initialized at dialog creation
sudo sections: move add fields and columns to widget definition.
The parameter validation in IPA.column ...This is precondition checking. Note that it merely throws an exception if the entity_name is not set. I want this stuff at the top of the function so that it is obvious to people looking to use them what is required. I added a comment to make this clear, but I'd like to keep precondition checking at the top of the function.
decreased the scope of the pkey_name and moved the initiailzation fof columns into the setup_column function for association_tables
return false at the end of click handler
removed blank labels in sudo command section
fix radio buttons for sudo category
fixed table side for adder dialogs with external fields
comments for future direction with add_columns
https://fedorahosted.org/freeipa/ticket/1451
https://fedorahosted.org/freeipa/ticket/1462
https://fedorahosted.org/freeipa/ticket/1493
https://fedorahosted.org/freeipa/ticket/1497
https://fedorahosted.org/freeipa/ticket/1532
https://fedorahosted.org/freeipa/ticket/1534
2011-07-25 12:15:14 -04:00
|
|
|
function options_section(){
|
|
|
|
|
var section = IPA.sudo.options_section({
|
|
|
|
|
name: 'options',
|
|
|
|
|
label: IPA.messages.objects.sudorule.options,
|
|
|
|
|
entity: that.entity,
|
|
|
|
|
facet: that
|
|
|
|
|
});
|
|
|
|
|
return section;
|
2011-11-29 13:36:07 +01:00
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Users
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
spec.fields.push(
|
|
|
|
|
{
|
|
|
|
|
type: 'radio',
|
|
|
|
|
name: 'usercategory',
|
|
|
|
|
widget: 'user.rule.usercategory'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
2011-08-19 10:20:40 -05:00
|
|
|
name: 'memberuser_user',
|
2011-11-29 13:36:07 +01:00
|
|
|
widget: 'user.rule.memberuser_user',
|
2011-12-15 13:40:29 +01:00
|
|
|
external: 'externaluser',
|
2011-11-29 13:36:07 +01:00
|
|
|
priority: IPA.sudo.remove_method_priority
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
2011-08-19 10:20:40 -05:00
|
|
|
name: 'memberuser_group',
|
2011-11-29 13:36:07 +01:00
|
|
|
widget: 'user.rule.memberuser_group',
|
|
|
|
|
priority: IPA.sudo.remove_method_priority
|
|
|
|
|
}
|
|
|
|
|
);
|
removing setters setup and init
change widget and widget unit tests to hold on to entity, not entity name.
Replacing entity_name with entity.name in most places.
The one exception is columns for table_widget.
Widgets that refer to other entities have to have late resolution of the entity object, due to circular dependencies.
cleanup entity assignment.
removed template and layout,
merged setup into create
adder dialogs adjust height for external
removed init from widget, isection, association, facet, host and service
Make unit tests use factory.
fix functional tests to click find link correctly.
tweak to activation test, but still broken.
moved initialization code to the end
use --all for hbacrule find, so the type shows up now
fixed dns exception code and exception handling for get_entity
replace metadata look up with value from entity.
fixed author lines
removed duplicate columns in managed by facets.
tweak to nav fix in order to initialize tab.
more defensive code
update metadata for true false
one line init for entity_name in widget
move init code to end of constructor functions
moved constants to start of function for adder_dialog
external fields for dialogs initialized at dialog creation
sudo sections: move add fields and columns to widget definition.
The parameter validation in IPA.column ...This is precondition checking. Note that it merely throws an exception if the entity_name is not set. I want this stuff at the top of the function so that it is obvious to people looking to use them what is required. I added a comment to make this clear, but I'd like to keep precondition checking at the top of the function.
decreased the scope of the pkey_name and moved the initiailzation fof columns into the setup_column function for association_tables
return false at the end of click handler
removed blank labels in sudo command section
fix radio buttons for sudo category
fixed table side for adder dialogs with external fields
comments for future direction with add_columns
https://fedorahosted.org/freeipa/ticket/1451
https://fedorahosted.org/freeipa/ticket/1462
https://fedorahosted.org/freeipa/ticket/1493
https://fedorahosted.org/freeipa/ticket/1497
https://fedorahosted.org/freeipa/ticket/1532
https://fedorahosted.org/freeipa/ticket/1534
2011-07-25 12:15:14 -04:00
|
|
|
|
2011-11-29 13:36:07 +01:00
|
|
|
spec.widgets.push(
|
|
|
|
|
{
|
|
|
|
|
factory: IPA.collapsible_section,
|
|
|
|
|
name: 'user',
|
|
|
|
|
label: IPA.messages.objects.sudorule.user,
|
|
|
|
|
widgets: [
|
|
|
|
|
{
|
|
|
|
|
factory: IPA.rule_details_widget,
|
|
|
|
|
name: 'rule',
|
|
|
|
|
radio_name: 'usercategory',
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
value: 'all',
|
|
|
|
|
label: IPA.messages.objects.sudorule.anyone
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: '',
|
|
|
|
|
label: IPA.messages.objects.sudorule.specified_users
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
tables: [
|
|
|
|
|
{ name: 'memberuser_user' },
|
|
|
|
|
{ name: 'memberuser_group' }
|
|
|
|
|
],
|
|
|
|
|
widgets: [
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
|
|
|
|
id: entity_name+'-memberuser_user',
|
|
|
|
|
name: 'memberuser_user',
|
|
|
|
|
add_method: 'add_user',
|
|
|
|
|
remove_method: 'remove_user',
|
|
|
|
|
external: 'externaluser',
|
|
|
|
|
add_title: IPA.messages.association.add.member,
|
|
|
|
|
remove_title: IPA.messages.association.remove.member
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
|
|
|
|
id: entity_name+'-memberuser_group',
|
|
|
|
|
name: 'memberuser_group',
|
|
|
|
|
add_method: 'add_user',
|
|
|
|
|
remove_method: 'remove_user',
|
|
|
|
|
add_title: IPA.messages.association.add.member,
|
|
|
|
|
remove_title: IPA.messages.association.remove.member
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
removing setters setup and init
change widget and widget unit tests to hold on to entity, not entity name.
Replacing entity_name with entity.name in most places.
The one exception is columns for table_widget.
Widgets that refer to other entities have to have late resolution of the entity object, due to circular dependencies.
cleanup entity assignment.
removed template and layout,
merged setup into create
adder dialogs adjust height for external
removed init from widget, isection, association, facet, host and service
Make unit tests use factory.
fix functional tests to click find link correctly.
tweak to activation test, but still broken.
moved initialization code to the end
use --all for hbacrule find, so the type shows up now
fixed dns exception code and exception handling for get_entity
replace metadata look up with value from entity.
fixed author lines
removed duplicate columns in managed by facets.
tweak to nav fix in order to initialize tab.
more defensive code
update metadata for true false
one line init for entity_name in widget
move init code to end of constructor functions
moved constants to start of function for adder_dialog
external fields for dialogs initialized at dialog creation
sudo sections: move add fields and columns to widget definition.
The parameter validation in IPA.column ...This is precondition checking. Note that it merely throws an exception if the entity_name is not set. I want this stuff at the top of the function so that it is obvious to people looking to use them what is required. I added a comment to make this clear, but I'd like to keep precondition checking at the top of the function.
decreased the scope of the pkey_name and moved the initiailzation fof columns into the setup_column function for association_tables
return false at the end of click handler
removed blank labels in sudo command section
fix radio buttons for sudo category
fixed table side for adder dialogs with external fields
comments for future direction with add_columns
https://fedorahosted.org/freeipa/ticket/1451
https://fedorahosted.org/freeipa/ticket/1462
https://fedorahosted.org/freeipa/ticket/1493
https://fedorahosted.org/freeipa/ticket/1497
https://fedorahosted.org/freeipa/ticket/1532
https://fedorahosted.org/freeipa/ticket/1534
2011-07-25 12:15:14 -04:00
|
|
|
]
|
2011-11-29 13:36:07 +01:00
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Hosts
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
spec.fields.push(
|
|
|
|
|
{
|
|
|
|
|
type: 'radio',
|
|
|
|
|
name: 'hostcategory',
|
|
|
|
|
widget: 'host.rule.hostcategory'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
2011-08-19 10:20:40 -05:00
|
|
|
name: 'memberhost_host',
|
2011-11-29 13:36:07 +01:00
|
|
|
widget: 'host.rule.memberhost_host',
|
2011-12-15 13:40:29 +01:00
|
|
|
external: 'externalhost',
|
2011-11-29 13:36:07 +01:00
|
|
|
priority: IPA.sudo.remove_method_priority
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
2011-08-19 10:20:40 -05:00
|
|
|
name: 'memberhost_hostgroup',
|
2011-11-29 13:36:07 +01:00
|
|
|
widget: 'host.rule.memberhost_hostgroup',
|
|
|
|
|
priority: IPA.sudo.remove_method_priority
|
|
|
|
|
}
|
|
|
|
|
);
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
|
2011-11-29 13:36:07 +01:00
|
|
|
spec.widgets.push(
|
|
|
|
|
{
|
|
|
|
|
factory: IPA.collapsible_section,
|
|
|
|
|
name: 'host',
|
|
|
|
|
label: IPA.messages.objects.sudorule.host,
|
|
|
|
|
widgets: [
|
|
|
|
|
{
|
|
|
|
|
factory: IPA.rule_details_widget,
|
|
|
|
|
name: 'rule',
|
|
|
|
|
radio_name: 'hostcategory',
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
'value': 'all',
|
|
|
|
|
'label': IPA.messages.objects.sudorule.any_host
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
'value': '',
|
|
|
|
|
'label': IPA.messages.objects.sudorule.specified_hosts
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
tables: [
|
|
|
|
|
{ 'name': 'memberhost_host' },
|
|
|
|
|
{ 'name': 'memberhost_hostgroup' }
|
|
|
|
|
],
|
|
|
|
|
widgets: [
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
|
|
|
|
id: entity_name+'-memberuser_user',
|
|
|
|
|
name: 'memberhost_host',
|
|
|
|
|
add_method: 'add_host',
|
|
|
|
|
remove_method: 'remove_host',
|
|
|
|
|
external: 'externalhost',
|
|
|
|
|
add_title: IPA.messages.association.add.member,
|
|
|
|
|
remove_title: IPA.messages.association.remove.member
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
|
|
|
|
id: entity_name+'-memberuser_group',
|
|
|
|
|
name: 'memberhost_hostgroup',
|
|
|
|
|
add_method: 'add_host',
|
|
|
|
|
remove_method: 'remove_host',
|
|
|
|
|
add_title: IPA.messages.association.add.member,
|
|
|
|
|
remove_title: IPA.messages.association.remove.member
|
|
|
|
|
}
|
|
|
|
|
]
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
}
|
2011-11-29 13:36:07 +01:00
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
);
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
|
2011-11-29 13:36:07 +01:00
|
|
|
//
|
|
|
|
|
// Run Commands
|
|
|
|
|
//
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
|
2011-11-29 13:36:07 +01:00
|
|
|
spec.fields.push(
|
|
|
|
|
{
|
|
|
|
|
type: 'radio',
|
|
|
|
|
name: 'cmdcategory',
|
|
|
|
|
widget: 'command.rule.cmdcategory'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
|
|
|
|
name: 'memberallowcmd_sudocmd',
|
|
|
|
|
widget: 'command.rule.memberallowcmd_sudocmd',
|
|
|
|
|
priority: IPA.sudo.remove_method_priority
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
|
|
|
|
name: 'memberallowcmd_sudocmdgroup',
|
|
|
|
|
widget: 'command.rule.memberallowcmd_sudocmdgroup',
|
|
|
|
|
priority: IPA.sudo.remove_method_priority
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
|
|
|
|
name: 'memberdenycmd_sudocmd',
|
|
|
|
|
widget: 'command.memberdenycmd_sudocmd',
|
|
|
|
|
priority: IPA.sudo.remove_method_priority
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
|
|
|
|
name: 'memberdenycmd_sudocmdgroup',
|
|
|
|
|
widget: 'command.memberdenycmd_sudocmdgroup',
|
|
|
|
|
priority: IPA.sudo.remove_method_priority
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
spec.widgets.push(
|
|
|
|
|
{
|
|
|
|
|
factory: IPA.collapsible_section,
|
|
|
|
|
name: 'command',
|
|
|
|
|
label: IPA.messages.objects.sudorule.command,
|
|
|
|
|
widgets: [
|
|
|
|
|
{
|
|
|
|
|
factory: IPA.header_widget,
|
|
|
|
|
name: 'allow_header',
|
|
|
|
|
text: IPA.messages.objects.sudorule.allow,
|
|
|
|
|
description: IPA.messages.objects.sudorule.allow
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
factory: IPA.rule_details_widget,
|
|
|
|
|
name: 'rule',
|
|
|
|
|
radio_name: 'cmdcategory',
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
value: 'all',
|
|
|
|
|
label: IPA.messages.objects.sudorule.anyone
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: '',
|
|
|
|
|
label: IPA.messages.objects.sudorule.specified_users
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
tables: [
|
|
|
|
|
{ name: 'memberallowcmd_sudocmd' },
|
|
|
|
|
{ name: 'memberallowcmd_sudocmdgroup' }
|
|
|
|
|
],
|
|
|
|
|
widgets: [
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
|
|
|
|
id: entity_name+'-memberallowcmd_sudocmd',
|
|
|
|
|
name: 'memberallowcmd_sudocmd',
|
|
|
|
|
add_method: 'add_allow_command',
|
|
|
|
|
remove_method: 'remove_allow_command',
|
|
|
|
|
add_title: IPA.messages.association.add.memberallowcmd,
|
|
|
|
|
remove_title: IPA.messages.association.remove.memberallowcmd
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
|
|
|
|
id: entity_name+'-memberallowcmd_sudocmdgroup',
|
|
|
|
|
name: 'memberallowcmd_sudocmdgroup',
|
|
|
|
|
add_method: 'add_allow_command',
|
|
|
|
|
remove_method: 'remove_allow_command',
|
|
|
|
|
add_title: IPA.messages.association.add.memberallowcmd,
|
|
|
|
|
remove_title: IPA.messages.association.remove.memberallowcmd
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
factory: IPA.header_widget,
|
|
|
|
|
name: 'deny_header',
|
|
|
|
|
text: IPA.messages.objects.sudorule.deny,
|
|
|
|
|
description: IPA.messages.objects.sudorule.deny
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
|
|
|
|
id: entity_name+'-memberdenycmd_sudocmd',
|
|
|
|
|
name: 'memberdenycmd_sudocmd',
|
|
|
|
|
add_method: 'add_deny_command',
|
|
|
|
|
remove_method: 'remove_deny_command',
|
|
|
|
|
add_title: IPA.messages.association.add.memberdenycmd,
|
|
|
|
|
remove_title: IPA.messages.association.remove.memberdenycmd
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
|
|
|
|
id: entity_name+'-memberdenycmd_sudocmdgroup',
|
|
|
|
|
name: 'memberdenycmd_sudocmdgroup',
|
|
|
|
|
add_method: 'add_deny_command',
|
|
|
|
|
remove_method: 'remove_deny_command',
|
|
|
|
|
add_title: IPA.messages.association.add.memberdenycmd,
|
|
|
|
|
remove_title: IPA.messages.association.remove.memberdenycmd
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
}
|
2011-11-29 13:36:07 +01:00
|
|
|
]
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
}
|
2011-11-29 13:36:07 +01:00
|
|
|
);
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
|
2011-11-29 13:36:07 +01:00
|
|
|
//
|
|
|
|
|
// As whom
|
|
|
|
|
//
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
|
2011-11-29 13:36:07 +01:00
|
|
|
spec.fields.push(
|
|
|
|
|
{
|
|
|
|
|
type: 'radio',
|
|
|
|
|
name: 'ipasudorunasusercategory',
|
|
|
|
|
widget: 'runas.runas_users.ipasudorunasusercategory'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
|
|
|
|
name: 'ipasudorunas_user',
|
|
|
|
|
widget: 'runas.runas_users.ipasudorunas_user',
|
2011-12-15 13:40:29 +01:00
|
|
|
external: 'ipasudorunasextuser',
|
2011-11-29 13:36:07 +01:00
|
|
|
priority: IPA.sudo.remove_method_priority
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
|
|
|
|
name: 'ipasudorunas_group',
|
|
|
|
|
widget: 'runas.runas_users.ipasudorunas_group',
|
|
|
|
|
priority: IPA.sudo.remove_method_priority
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'radio',
|
|
|
|
|
name: 'ipasudorunasgroupcategory',
|
|
|
|
|
widget: 'runas.runas_groups.ipasudorunasgroupcategory'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
|
|
|
|
name: 'ipasudorunasgroup_group',
|
|
|
|
|
widget: 'runas.runas_groups.ipasudorunasgroup_group',
|
2011-12-15 13:40:29 +01:00
|
|
|
external: 'ipasudorunasextgroup',
|
2011-11-29 13:36:07 +01:00
|
|
|
priority: IPA.sudo.remove_method_priority
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
}
|
2011-11-29 13:36:07 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
spec.widgets.push(
|
|
|
|
|
{
|
|
|
|
|
factory: IPA.collapsible_section,
|
|
|
|
|
name: 'runas',
|
|
|
|
|
label: IPA.messages.objects.sudorule.runas,
|
|
|
|
|
widgets: [
|
|
|
|
|
{
|
|
|
|
|
factory: IPA.rule_details_widget,
|
|
|
|
|
name: 'runas_users',
|
|
|
|
|
radio_name: 'ipasudorunasusercategory',
|
|
|
|
|
options: [
|
|
|
|
|
{ value: 'all', label: IPA.messages.objects.sudorule.anyone },
|
|
|
|
|
{ value: '', label: IPA.messages.objects.sudorule.specified_users }
|
|
|
|
|
],
|
|
|
|
|
tables: [
|
|
|
|
|
{ name: 'ipasudorunas_user' },
|
|
|
|
|
{ name: 'ipasudorunas_group' }
|
|
|
|
|
],
|
|
|
|
|
widgets: [
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
|
|
|
|
id: entity_name+'-runasruser_user',
|
|
|
|
|
name: 'ipasudorunas_user',
|
|
|
|
|
external: 'ipasudorunasextuser',
|
|
|
|
|
add_method: 'add_runasuser',
|
|
|
|
|
remove_method: 'remove_runasuser',
|
|
|
|
|
add_title: IPA.messages.association.add.ipasudorunas,
|
|
|
|
|
remove_title: IPA.messages.association.remove.ipasudorunas
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'rule_association_table',
|
|
|
|
|
id: entity_name+'-runasuser_group',
|
|
|
|
|
name: 'ipasudorunas_group',
|
|
|
|
|
add_method: 'add_runasuser',
|
|
|
|
|
remove_method: 'remove_runasuser',
|
|
|
|
|
add_title: IPA.messages.association.add.ipasudorunas,
|
|
|
|
|
remove_title: IPA.messages.association.remove.ipasudorunas
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
factory: IPA.rule_details_widget,
|
|
|
|
|
name: 'runas_groups',
|
|
|
|
|
radio_name: 'ipasudorunasgroupcategory',
|
|
|
|
|
options: [
|
|
|
|
|
{ value: 'all', label: IPA.messages.objects.sudorule.any_group },
|
|
|
|
|
{ value: '', label: IPA.messages.objects.sudorule.specified_groups }
|
|
|
|
|
],
|
|
|
|
|
tables: [
|
|
|
|
|
{ name: 'ipasudorunasgroup_group' }
|
|
|
|
|
],
|
|
|
|
|
widgets: [{
|
|
|
|
|
type: 'rule_association_table',
|
|
|
|
|
id: entity_name+'-runasgroup_group',
|
|
|
|
|
name: 'ipasudorunasgroup_group',
|
|
|
|
|
external: 'ipasudorunasextgroup',
|
|
|
|
|
add_method: 'add_runasgroup',
|
|
|
|
|
remove_method: 'remove_runasgroup',
|
|
|
|
|
add_title: IPA.messages.association.add.ipasudorunasgroup,
|
|
|
|
|
remove_title: IPA.messages.association.remove.ipasudorunasgroup
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
]
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
}
|
2011-11-29 13:36:07 +01:00
|
|
|
);
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
|
2011-11-29 13:36:07 +01:00
|
|
|
var that = IPA.details_facet(spec);
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
|
2011-11-29 13:36:07 +01:00
|
|
|
var init = function() {
|
|
|
|
|
var options = that.widgets.get_widget('options');
|
|
|
|
|
options.facet = that;
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
};
|
|
|
|
|
|
2011-11-29 13:36:07 +01:00
|
|
|
that.on_update_success = function(data, text_status, xhr) {
|
|
|
|
|
that.refresh();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
that.on_update_error = function(xhr, text_status, error_thrown) {
|
|
|
|
|
that.refresh();
|
|
|
|
|
};
|
removing setters setup and init
change widget and widget unit tests to hold on to entity, not entity name.
Replacing entity_name with entity.name in most places.
The one exception is columns for table_widget.
Widgets that refer to other entities have to have late resolution of the entity object, due to circular dependencies.
cleanup entity assignment.
removed template and layout,
merged setup into create
adder dialogs adjust height for external
removed init from widget, isection, association, facet, host and service
Make unit tests use factory.
fix functional tests to click find link correctly.
tweak to activation test, but still broken.
moved initialization code to the end
use --all for hbacrule find, so the type shows up now
fixed dns exception code and exception handling for get_entity
replace metadata look up with value from entity.
fixed author lines
removed duplicate columns in managed by facets.
tweak to nav fix in order to initialize tab.
more defensive code
update metadata for true false
one line init for entity_name in widget
move init code to end of constructor functions
moved constants to start of function for adder_dialog
external fields for dialogs initialized at dialog creation
sudo sections: move add fields and columns to widget definition.
The parameter validation in IPA.column ...This is precondition checking. Note that it merely throws an exception if the entity_name is not set. I want this stuff at the top of the function so that it is obvious to people looking to use them what is required. I added a comment to make this clear, but I'd like to keep precondition checking at the top of the function.
decreased the scope of the pkey_name and moved the initiailzation fof columns into the setup_column function for association_tables
return false at the end of click handler
removed blank labels in sudo command section
fix radio buttons for sudo category
fixed table side for adder dialogs with external fields
comments for future direction with add_columns
https://fedorahosted.org/freeipa/ticket/1451
https://fedorahosted.org/freeipa/ticket/1462
https://fedorahosted.org/freeipa/ticket/1493
https://fedorahosted.org/freeipa/ticket/1497
https://fedorahosted.org/freeipa/ticket/1532
https://fedorahosted.org/freeipa/ticket/1534
2011-07-25 12:15:14 -04:00
|
|
|
|
2011-11-29 13:36:07 +01:00
|
|
|
init();
|
removing setters setup and init
change widget and widget unit tests to hold on to entity, not entity name.
Replacing entity_name with entity.name in most places.
The one exception is columns for table_widget.
Widgets that refer to other entities have to have late resolution of the entity object, due to circular dependencies.
cleanup entity assignment.
removed template and layout,
merged setup into create
adder dialogs adjust height for external
removed init from widget, isection, association, facet, host and service
Make unit tests use factory.
fix functional tests to click find link correctly.
tweak to activation test, but still broken.
moved initialization code to the end
use --all for hbacrule find, so the type shows up now
fixed dns exception code and exception handling for get_entity
replace metadata look up with value from entity.
fixed author lines
removed duplicate columns in managed by facets.
tweak to nav fix in order to initialize tab.
more defensive code
update metadata for true false
one line init for entity_name in widget
move init code to end of constructor functions
moved constants to start of function for adder_dialog
external fields for dialogs initialized at dialog creation
sudo sections: move add fields and columns to widget definition.
The parameter validation in IPA.column ...This is precondition checking. Note that it merely throws an exception if the entity_name is not set. I want this stuff at the top of the function so that it is obvious to people looking to use them what is required. I added a comment to make this clear, but I'd like to keep precondition checking at the top of the function.
decreased the scope of the pkey_name and moved the initiailzation fof columns into the setup_column function for association_tables
return false at the end of click handler
removed blank labels in sudo command section
fix radio buttons for sudo category
fixed table side for adder dialogs with external fields
comments for future direction with add_columns
https://fedorahosted.org/freeipa/ticket/1451
https://fedorahosted.org/freeipa/ticket/1462
https://fedorahosted.org/freeipa/ticket/1493
https://fedorahosted.org/freeipa/ticket/1497
https://fedorahosted.org/freeipa/ticket/1532
https://fedorahosted.org/freeipa/ticket/1534
2011-07-25 12:15:14 -04:00
|
|
|
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
return that;
|
2011-01-14 12:16:25 -05:00
|
|
|
};
|
|
|
|
|
|
2011-07-09 03:01:46 -05:00
|
|
|
IPA.sudo.options_section = function(spec) {
|
|
|
|
|
|
|
|
|
|
spec = spec || {};
|
|
|
|
|
|
2011-11-29 13:36:07 +01:00
|
|
|
var that = IPA.collapsible_section(spec);
|
2011-07-09 03:01:46 -05:00
|
|
|
|
removing setters setup and init
change widget and widget unit tests to hold on to entity, not entity name.
Replacing entity_name with entity.name in most places.
The one exception is columns for table_widget.
Widgets that refer to other entities have to have late resolution of the entity object, due to circular dependencies.
cleanup entity assignment.
removed template and layout,
merged setup into create
adder dialogs adjust height for external
removed init from widget, isection, association, facet, host and service
Make unit tests use factory.
fix functional tests to click find link correctly.
tweak to activation test, but still broken.
moved initialization code to the end
use --all for hbacrule find, so the type shows up now
fixed dns exception code and exception handling for get_entity
replace metadata look up with value from entity.
fixed author lines
removed duplicate columns in managed by facets.
tweak to nav fix in order to initialize tab.
more defensive code
update metadata for true false
one line init for entity_name in widget
move init code to end of constructor functions
moved constants to start of function for adder_dialog
external fields for dialogs initialized at dialog creation
sudo sections: move add fields and columns to widget definition.
The parameter validation in IPA.column ...This is precondition checking. Note that it merely throws an exception if the entity_name is not set. I want this stuff at the top of the function so that it is obvious to people looking to use them what is required. I added a comment to make this clear, but I'd like to keep precondition checking at the top of the function.
decreased the scope of the pkey_name and moved the initiailzation fof columns into the setup_column function for association_tables
return false at the end of click handler
removed blank labels in sudo command section
fix radio buttons for sudo category
fixed table side for adder dialogs with external fields
comments for future direction with add_columns
https://fedorahosted.org/freeipa/ticket/1451
https://fedorahosted.org/freeipa/ticket/1462
https://fedorahosted.org/freeipa/ticket/1493
https://fedorahosted.org/freeipa/ticket/1497
https://fedorahosted.org/freeipa/ticket/1532
https://fedorahosted.org/freeipa/ticket/1534
2011-07-25 12:15:14 -04:00
|
|
|
function setup_table(){
|
2011-11-29 13:36:07 +01:00
|
|
|
that.table = IPA.table_widget({
|
2011-07-09 03:01:46 -05:00
|
|
|
name: 'ipasudoopt',
|
|
|
|
|
show_buttons: true
|
2011-11-29 13:36:07 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
that.widgets.add_widget(that.table);
|
2011-07-09 03:01:46 -05:00
|
|
|
|
|
|
|
|
that.table.create_column({
|
|
|
|
|
name: 'ipasudoopt',
|
2011-11-16 15:13:32 -06:00
|
|
|
label: IPA.get_command_option('sudorule_add_option', 'ipasudoopt').label,
|
removing setters setup and init
change widget and widget unit tests to hold on to entity, not entity name.
Replacing entity_name with entity.name in most places.
The one exception is columns for table_widget.
Widgets that refer to other entities have to have late resolution of the entity object, due to circular dependencies.
cleanup entity assignment.
removed template and layout,
merged setup into create
adder dialogs adjust height for external
removed init from widget, isection, association, facet, host and service
Make unit tests use factory.
fix functional tests to click find link correctly.
tweak to activation test, but still broken.
moved initialization code to the end
use --all for hbacrule find, so the type shows up now
fixed dns exception code and exception handling for get_entity
replace metadata look up with value from entity.
fixed author lines
removed duplicate columns in managed by facets.
tweak to nav fix in order to initialize tab.
more defensive code
update metadata for true false
one line init for entity_name in widget
move init code to end of constructor functions
moved constants to start of function for adder_dialog
external fields for dialogs initialized at dialog creation
sudo sections: move add fields and columns to widget definition.
The parameter validation in IPA.column ...This is precondition checking. Note that it merely throws an exception if the entity_name is not set. I want this stuff at the top of the function so that it is obvious to people looking to use them what is required. I added a comment to make this clear, but I'd like to keep precondition checking at the top of the function.
decreased the scope of the pkey_name and moved the initiailzation fof columns into the setup_column function for association_tables
return false at the end of click handler
removed blank labels in sudo command section
fix radio buttons for sudo category
fixed table side for adder dialogs with external fields
comments for future direction with add_columns
https://fedorahosted.org/freeipa/ticket/1451
https://fedorahosted.org/freeipa/ticket/1462
https://fedorahosted.org/freeipa/ticket/1493
https://fedorahosted.org/freeipa/ticket/1497
https://fedorahosted.org/freeipa/ticket/1532
https://fedorahosted.org/freeipa/ticket/1534
2011-07-25 12:15:14 -04:00
|
|
|
entity_name:that.entity.name,
|
2011-07-09 03:01:46 -05:00
|
|
|
primary_key: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
that.table.create = function(container) {
|
|
|
|
|
|
|
|
|
|
that.table.table_create(container);
|
|
|
|
|
|
2011-09-30 16:52:41 -05:00
|
|
|
that.remove_button = IPA.action_button({
|
2011-07-09 03:01:46 -05:00
|
|
|
name: 'remove',
|
|
|
|
|
label: IPA.messages.buttons.remove,
|
|
|
|
|
icon: 'remove-icon',
|
2011-09-30 16:52:41 -05:00
|
|
|
'class': 'action-button-disabled',
|
2011-07-09 03:01:46 -05:00
|
|
|
click: function() {
|
2011-09-30 16:52:41 -05:00
|
|
|
if (!that.remove_button.hasClass('action-button-disabled')) {
|
|
|
|
|
that.remove_handler();
|
|
|
|
|
}
|
2011-07-09 03:01:46 -05:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}).appendTo(that.table.buttons);
|
|
|
|
|
|
2011-09-30 16:52:41 -05:00
|
|
|
that.add_button = IPA.action_button({
|
2011-07-09 03:01:46 -05:00
|
|
|
name: 'add',
|
|
|
|
|
label: IPA.messages.buttons.add,
|
|
|
|
|
icon: 'add-icon',
|
|
|
|
|
click: function() {
|
2011-09-30 16:52:41 -05:00
|
|
|
if (!that.add_button.hasClass('action-button-disabled')) {
|
|
|
|
|
that.add_handler();
|
|
|
|
|
}
|
2011-07-09 03:01:46 -05:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}).appendTo(that.table.buttons);
|
|
|
|
|
};
|
2011-09-30 16:52:41 -05:00
|
|
|
|
|
|
|
|
that.table.select_changed = function() {
|
|
|
|
|
|
|
|
|
|
var values = that.table.get_selected_values();
|
|
|
|
|
|
|
|
|
|
if (that.remove_button) {
|
|
|
|
|
if (values.length === 0) {
|
|
|
|
|
that.remove_button.addClass('action-button-disabled');
|
|
|
|
|
} else {
|
|
|
|
|
that.remove_button.removeClass('action-button-disabled');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
2011-11-29 13:36:07 +01:00
|
|
|
|
|
|
|
|
that.table.update = function(values) {
|
|
|
|
|
|
|
|
|
|
that.table.empty();
|
|
|
|
|
|
|
|
|
|
for (var i=0; i<values.length; i++) {
|
|
|
|
|
var value = values[i];
|
|
|
|
|
if(!value || value === '') continue;
|
|
|
|
|
|
|
|
|
|
var record = {
|
|
|
|
|
ipasudoopt: values[i]
|
|
|
|
|
};
|
|
|
|
|
that.table.add_record(record);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
that.table.unselect_all();
|
|
|
|
|
};
|
removing setters setup and init
change widget and widget unit tests to hold on to entity, not entity name.
Replacing entity_name with entity.name in most places.
The one exception is columns for table_widget.
Widgets that refer to other entities have to have late resolution of the entity object, due to circular dependencies.
cleanup entity assignment.
removed template and layout,
merged setup into create
adder dialogs adjust height for external
removed init from widget, isection, association, facet, host and service
Make unit tests use factory.
fix functional tests to click find link correctly.
tweak to activation test, but still broken.
moved initialization code to the end
use --all for hbacrule find, so the type shows up now
fixed dns exception code and exception handling for get_entity
replace metadata look up with value from entity.
fixed author lines
removed duplicate columns in managed by facets.
tweak to nav fix in order to initialize tab.
more defensive code
update metadata for true false
one line init for entity_name in widget
move init code to end of constructor functions
moved constants to start of function for adder_dialog
external fields for dialogs initialized at dialog creation
sudo sections: move add fields and columns to widget definition.
The parameter validation in IPA.column ...This is precondition checking. Note that it merely throws an exception if the entity_name is not set. I want this stuff at the top of the function so that it is obvious to people looking to use them what is required. I added a comment to make this clear, but I'd like to keep precondition checking at the top of the function.
decreased the scope of the pkey_name and moved the initiailzation fof columns into the setup_column function for association_tables
return false at the end of click handler
removed blank labels in sudo command section
fix radio buttons for sudo category
fixed table side for adder dialogs with external fields
comments for future direction with add_columns
https://fedorahosted.org/freeipa/ticket/1451
https://fedorahosted.org/freeipa/ticket/1462
https://fedorahosted.org/freeipa/ticket/1493
https://fedorahosted.org/freeipa/ticket/1497
https://fedorahosted.org/freeipa/ticket/1532
https://fedorahosted.org/freeipa/ticket/1534
2011-07-25 12:15:14 -04:00
|
|
|
}
|
2011-07-09 03:01:46 -05:00
|
|
|
|
|
|
|
|
that.add_handler = function() {
|
|
|
|
|
if (that.facet.is_dirty()) {
|
|
|
|
|
var dialog = IPA.dirty_dialog({
|
|
|
|
|
facet: that.facet
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
dialog.callback = function() {
|
|
|
|
|
that.show_add_dialog();
|
|
|
|
|
};
|
|
|
|
|
dialog.open(that.container);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
that.show_add_dialog();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
that.remove_handler = function() {
|
|
|
|
|
if (that.facet.is_dirty()) {
|
|
|
|
|
var dialog = IPA.dirty_dialog({
|
|
|
|
|
facet: that.facet
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
dialog.callback = function() {
|
|
|
|
|
that.show_remove_dialog();
|
|
|
|
|
};
|
|
|
|
|
dialog.open(that.container);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
that.show_remove_dialog();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
that.show_add_dialog = function() {
|
|
|
|
|
|
2011-11-16 15:13:32 -06:00
|
|
|
var label = IPA.get_command_option('sudorule_add_option', 'ipasudoopt').label;
|
2011-07-09 03:01:46 -05:00
|
|
|
|
|
|
|
|
var title = IPA.messages.dialogs.add_title;
|
|
|
|
|
title = title.replace('${entity}', label);
|
|
|
|
|
|
|
|
|
|
var dialog = IPA.dialog({
|
2011-11-29 13:36:07 +01:00
|
|
|
title: title,
|
|
|
|
|
sections: [
|
|
|
|
|
{
|
|
|
|
|
fields: [
|
|
|
|
|
{
|
|
|
|
|
name: 'ipasudoopt',
|
|
|
|
|
label: label
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
]
|
2011-07-09 03:01:46 -05:00
|
|
|
});
|
|
|
|
|
|
2011-09-28 15:56:25 -05:00
|
|
|
dialog.create_button({
|
|
|
|
|
name: 'add',
|
|
|
|
|
label: IPA.messages.buttons.add,
|
|
|
|
|
click: function() {
|
2011-11-29 13:36:07 +01:00
|
|
|
var ipasudoopt = dialog.fields.get_field('ipasudoopt');
|
2011-09-28 15:56:25 -05:00
|
|
|
var value = ipasudoopt.save()[0];
|
|
|
|
|
|
|
|
|
|
var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
|
|
|
|
|
|
|
|
|
|
var command = IPA.command({
|
|
|
|
|
entity: 'sudorule',
|
|
|
|
|
method: 'add_option',
|
|
|
|
|
args: [pkey],
|
|
|
|
|
options: {
|
|
|
|
|
ipasudoopt: value
|
|
|
|
|
},
|
|
|
|
|
on_success: function(data) {
|
2011-11-29 13:36:07 +01:00
|
|
|
that.table.load(data.result.result);
|
2011-09-28 15:56:25 -05:00
|
|
|
dialog.close();
|
|
|
|
|
},
|
|
|
|
|
on_error: function(data) {
|
2011-11-29 13:36:07 +01:00
|
|
|
that.reload();
|
2011-09-28 15:56:25 -05:00
|
|
|
dialog.close();
|
|
|
|
|
}
|
|
|
|
|
});
|
2011-07-09 03:01:46 -05:00
|
|
|
|
2011-09-28 15:56:25 -05:00
|
|
|
command.execute();
|
|
|
|
|
}
|
2011-07-09 03:01:46 -05:00
|
|
|
});
|
|
|
|
|
|
2011-09-28 15:56:25 -05:00
|
|
|
dialog.create_button({
|
|
|
|
|
name: 'cancel',
|
|
|
|
|
label: IPA.messages.buttons.cancel,
|
|
|
|
|
click: function() {
|
|
|
|
|
dialog.close();
|
|
|
|
|
}
|
2011-07-09 03:01:46 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
dialog.open(that.container);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
that.show_remove_dialog = function() {
|
|
|
|
|
|
2011-11-16 15:13:32 -06:00
|
|
|
var label = IPA.get_command_option('sudorule_add_option', 'ipasudoopt').label;
|
2011-07-09 03:01:46 -05:00
|
|
|
var values = that.table.get_selected_values();
|
|
|
|
|
|
|
|
|
|
if (!values.length) {
|
|
|
|
|
var message = IPA.messages.dialogs.remove_empty;
|
|
|
|
|
alert(message);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
removing setters setup and init
change widget and widget unit tests to hold on to entity, not entity name.
Replacing entity_name with entity.name in most places.
The one exception is columns for table_widget.
Widgets that refer to other entities have to have late resolution of the entity object, due to circular dependencies.
cleanup entity assignment.
removed template and layout,
merged setup into create
adder dialogs adjust height for external
removed init from widget, isection, association, facet, host and service
Make unit tests use factory.
fix functional tests to click find link correctly.
tweak to activation test, but still broken.
moved initialization code to the end
use --all for hbacrule find, so the type shows up now
fixed dns exception code and exception handling for get_entity
replace metadata look up with value from entity.
fixed author lines
removed duplicate columns in managed by facets.
tweak to nav fix in order to initialize tab.
more defensive code
update metadata for true false
one line init for entity_name in widget
move init code to end of constructor functions
moved constants to start of function for adder_dialog
external fields for dialogs initialized at dialog creation
sudo sections: move add fields and columns to widget definition.
The parameter validation in IPA.column ...This is precondition checking. Note that it merely throws an exception if the entity_name is not set. I want this stuff at the top of the function so that it is obvious to people looking to use them what is required. I added a comment to make this clear, but I'd like to keep precondition checking at the top of the function.
decreased the scope of the pkey_name and moved the initiailzation fof columns into the setup_column function for association_tables
return false at the end of click handler
removed blank labels in sudo command section
fix radio buttons for sudo category
fixed table side for adder dialogs with external fields
comments for future direction with add_columns
https://fedorahosted.org/freeipa/ticket/1451
https://fedorahosted.org/freeipa/ticket/1462
https://fedorahosted.org/freeipa/ticket/1493
https://fedorahosted.org/freeipa/ticket/1497
https://fedorahosted.org/freeipa/ticket/1532
https://fedorahosted.org/freeipa/ticket/1534
2011-07-25 12:15:14 -04:00
|
|
|
var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
|
2011-07-09 03:01:46 -05:00
|
|
|
|
|
|
|
|
var title = IPA.messages.dialogs.remove_title;
|
|
|
|
|
title = title.replace('${entity}', label);
|
|
|
|
|
|
|
|
|
|
var dialog = IPA.deleter_dialog({
|
|
|
|
|
title: title,
|
|
|
|
|
values: values
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
dialog.execute = function() {
|
|
|
|
|
|
|
|
|
|
var batch = IPA.batch_command({
|
2011-08-26 18:36:54 +02:00
|
|
|
on_success: function(data) {
|
|
|
|
|
//last successful result of batch results contains valid data
|
|
|
|
|
var result;
|
|
|
|
|
for(var i = data.result.results.length - 1; i > -1; i--) {
|
|
|
|
|
result = data.result.results[i].result;
|
|
|
|
|
if(result) break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(result) {
|
2011-11-29 13:36:07 +01:00
|
|
|
that.table.load(result);
|
2011-08-26 18:36:54 +02:00
|
|
|
} else {
|
2011-11-29 13:36:07 +01:00
|
|
|
that.reload();
|
2011-08-26 18:36:54 +02:00
|
|
|
}
|
|
|
|
|
|
2011-07-09 03:01:46 -05:00
|
|
|
dialog.close();
|
|
|
|
|
},
|
2011-08-26 18:36:54 +02:00
|
|
|
on_error: function(data) {
|
2011-11-29 13:36:07 +01:00
|
|
|
that.reload();
|
2011-07-09 03:01:46 -05:00
|
|
|
dialog.close();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
for (var i=0; i<values.length; i++) {
|
|
|
|
|
var command = IPA.command({
|
|
|
|
|
entity: 'sudorule',
|
|
|
|
|
method: 'remove_option',
|
|
|
|
|
args: [pkey]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
command.set_option('ipasudoopt', values[i]);
|
|
|
|
|
|
|
|
|
|
batch.add_command(command);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
batch.execute();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dialog.open(that.container);
|
|
|
|
|
};
|
|
|
|
|
|
2011-11-29 13:36:07 +01:00
|
|
|
that.reload = function() {
|
2011-08-26 18:36:54 +02:00
|
|
|
var command = IPA.command({
|
|
|
|
|
entity: that.facet.entity.name,
|
|
|
|
|
method: 'show',
|
|
|
|
|
args: that.facet.get_primary_key(true),
|
|
|
|
|
on_success: function(data) {
|
2011-11-29 13:36:07 +01:00
|
|
|
that.table.load(data.result.result);
|
2011-08-26 18:36:54 +02:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
command.execute();
|
|
|
|
|
};
|
|
|
|
|
|
removing setters setup and init
change widget and widget unit tests to hold on to entity, not entity name.
Replacing entity_name with entity.name in most places.
The one exception is columns for table_widget.
Widgets that refer to other entities have to have late resolution of the entity object, due to circular dependencies.
cleanup entity assignment.
removed template and layout,
merged setup into create
adder dialogs adjust height for external
removed init from widget, isection, association, facet, host and service
Make unit tests use factory.
fix functional tests to click find link correctly.
tweak to activation test, but still broken.
moved initialization code to the end
use --all for hbacrule find, so the type shows up now
fixed dns exception code and exception handling for get_entity
replace metadata look up with value from entity.
fixed author lines
removed duplicate columns in managed by facets.
tweak to nav fix in order to initialize tab.
more defensive code
update metadata for true false
one line init for entity_name in widget
move init code to end of constructor functions
moved constants to start of function for adder_dialog
external fields for dialogs initialized at dialog creation
sudo sections: move add fields and columns to widget definition.
The parameter validation in IPA.column ...This is precondition checking. Note that it merely throws an exception if the entity_name is not set. I want this stuff at the top of the function so that it is obvious to people looking to use them what is required. I added a comment to make this clear, but I'd like to keep precondition checking at the top of the function.
decreased the scope of the pkey_name and moved the initiailzation fof columns into the setup_column function for association_tables
return false at the end of click handler
removed blank labels in sudo command section
fix radio buttons for sudo category
fixed table side for adder dialogs with external fields
comments for future direction with add_columns
https://fedorahosted.org/freeipa/ticket/1451
https://fedorahosted.org/freeipa/ticket/1462
https://fedorahosted.org/freeipa/ticket/1493
https://fedorahosted.org/freeipa/ticket/1497
https://fedorahosted.org/freeipa/ticket/1532
https://fedorahosted.org/freeipa/ticket/1534
2011-07-25 12:15:14 -04:00
|
|
|
/*initialization*/
|
|
|
|
|
setup_table();
|
SUDO adjustments
The SUDO rule details facet has been updated to support the latest UI
spec. The facet consists of 5 sections: general, users, hosts, commands,
and run-as.
The general section contains the SUDO rule description and status. If
the status is changed, the sudorule-enable/disable will be invoked.
The other sections contain radio buttons for the association category
and tables for the members. When a member is added or removed, the
category will be adjusted appropriately. If the category is changed to
'all', 'allow', or 'deny', all members will be removed.
The last section is currently not working because backend support is
not yet available.
The adder dialog boxes for users, groups, and hosts has been modified
to accept external identities. The layout for the base adder dialog
was updated. The base dialog class was updated to support templates.
The SUDO dialog boxes were implemented using templates. New CSS
classes were added to ipa.css.
The HBAC rule details facet has been updated as well.
2010-12-07 01:51:51 -06:00
|
|
|
|
|
|
|
|
return that;
|
2011-01-14 12:16:25 -05:00
|
|
|
};
|
|
|
|
|
|
2011-11-02 14:07:07 -05:00
|
|
|
IPA.register('sudorule', IPA.sudo.rule_entity);
|
|
|
|
|
IPA.register('sudocmd', IPA.sudo.command_entity);
|
|
|
|
|
IPA.register('sudocmdgroup', IPA.sudo.command_group_entity);
|