Index: openacs-4/packages/acs-admin/www/auth/authority-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/auth/authority-delete.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-admin/www/auth/authority-delete.tcl 10 Sep 2003 14:32:47 -0000 1.1 +++ openacs-4/packages/acs-admin/www/auth/authority-delete.tcl 11 Sep 2003 09:21:27 -0000 1.2 @@ -7,6 +7,16 @@ authority_id:integer } -auth::authority::delete -authority_id $authority_id +# Cannot delete local authority +if { [string equal $authority_id [auth::authority::local]] } { + ad_return_error "Cannot delete local authority" "The system requires the local authority to operate." +} -ad_returnredirect "." +if { [auth::can_admin_system_without_authority_p -authority_id $authority_id] } { + + auth::authority::delete -authority_id $authority_id + + ad_returnredirect "." +} else { + ad_return_error "Cannot delete authority" "Deleting this authority would mean that all site-wide administrator users are shut out from the system, meaning the system could no longer be adminstered." +}