From e4a444ba8159f890daa124d1c546b977a91b9f32 Mon Sep 17 00:00:00 2001 From: Adam Young Date: Tue, 5 Jul 2011 17:59:05 -0400 Subject: HBAC deny warning shows dialog if there are any HBAC deny rules. Dialog provides option to navigate to the HBAC page. Deny rules have their rule type value show up in red. Only shows up fro administrators, not for self service users. https://fedorahosted.org/freeipa/ticket/1421 --- install/ui/hbac.js | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) (limited to 'install/ui/hbac.js') diff --git a/install/ui/hbac.js b/install/ui/hbac.js index c082056b..dc85d572 100644 --- a/install/ui/hbac.js +++ b/install/ui/hbac.js @@ -26,7 +26,21 @@ IPA.entity_factories.hbacrule = function () { return IPA.entity_builder(). entity('hbacrule'). search_facet({ - columns:['cn','usercategory','hostcategory','ipaenabledflag', + columns:['cn', + { + factory: IPA.column, + name:'accessruletype', + setup : function(container,record){ + container.empty(); + var value = record[this.name]; + value = value ? value.toString() : ''; + if (value === 'deny'){ + container.addClass('hbac-deny-rule'); + } + container.append(value); + } + }, + 'usercategory','hostcategory','ipaenabledflag', 'servicecategory','sourcehostcategory'] }). details_facet({ @@ -996,3 +1010,40 @@ IPA.hbacrule_accesstime_widget = function (spec) { return that; }; + +IPA.hbac_deny_warning_dialog = function (container) { + var dialog = IPA.dialog({ + 'title': 'HBAC Deny Rules found' + }); + + var link_path = "config"; + if (IPA.use_static_files){ + link_path = "html"; + } + + dialog.create = function() { + dialog.container.append( + "HBAC rules with type deny have been found."+ + " These rules have been deprecated." + + " Please remove them, and restructure the HBAC rules." ); + $('

').append($('',{ + text: 'Click here for more information', + href: '../' +link_path +'/hbac-deny-remove.html', + target: "_blank", + style: 'target: tab; color: blue; ' + })).appendTo(dialog.container); + }; + + dialog.add_button('Edit HBAC Rules', function() { + dialog.close(); + IPA.nav.show_page('hbacrule', 'search'); + }); + + dialog.add_button('Ignore for now', function() { + dialog.close(); + }); + + dialog.init(); + + dialog.open(); +}; -- cgit