diff --git a/mozilla/webtools/bugzilla/chart.cgi b/mozilla/webtools/bugzilla/chart.cgi index 4bab17701a2..8b0d3971e94 100755 --- a/mozilla/webtools/bugzilla/chart.cgi +++ b/mozilla/webtools/bugzilla/chart.cgi @@ -84,9 +84,10 @@ if ($action eq "search") { Bugzilla->login(LOGIN_REQUIRED); -UserInGroup(Param("chartgroup")) - || ThrowUserError("authorization_failure", - {action => "use this feature"}); +UserInGroup(Param("chartgroup")) + || ThrowUserError("auth_failure", {group => Param("chartgroup"), + action => "use", + object => "charts"}); # Only admins may create public queries UserInGroup('admin') || $cgi->delete('public'); diff --git a/mozilla/webtools/bugzilla/editclassifications.cgi b/mozilla/webtools/bugzilla/editclassifications.cgi index c1186f7921e..777e76f755c 100755 --- a/mozilla/webtools/bugzilla/editclassifications.cgi +++ b/mozilla/webtools/bugzilla/editclassifications.cgi @@ -78,7 +78,11 @@ Bugzilla->login(LOGIN_REQUIRED); print $cgi->header(); -ThrowUserError("auth_cant_edit_classifications") unless UserInGroup("editclassifications"); +UserInGroup("editclassifications") + || ThrowUserError("auth_failure", {group => "editclassifications", + action => "edit", + object => "classifications"}); + ThrowUserError("auth_classification_not_enabled") unless Param("useclassification"); # diff --git a/mozilla/webtools/bugzilla/editcomponents.cgi b/mozilla/webtools/bugzilla/editcomponents.cgi index e2e471f34af..7c1ac96caa9 100755 --- a/mozilla/webtools/bugzilla/editcomponents.cgi +++ b/mozilla/webtools/bugzilla/editcomponents.cgi @@ -117,11 +117,10 @@ Bugzilla->login(LOGIN_REQUIRED); print Bugzilla->cgi->header(); -unless (UserInGroup("editcomponents")) { - ThrowUserError('auth_cant_edit_components'); - exit; -} - +UserInGroup("editcomponents") + || ThrowUserError("auth_failure", {group => "editcomponents", + action => "edit", + object => "components"}); # # often used variables diff --git a/mozilla/webtools/bugzilla/editflagtypes.cgi b/mozilla/webtools/bugzilla/editflagtypes.cgi index 4875b4f19f3..48074863ad1 100755 --- a/mozilla/webtools/bugzilla/editflagtypes.cgi +++ b/mozilla/webtools/bugzilla/editflagtypes.cgi @@ -42,8 +42,9 @@ use vars qw( $template $vars ); # Make sure the user is logged in and is an administrator. Bugzilla->login(LOGIN_REQUIRED); UserInGroup("editcomponents") - || ThrowUserError("authorization_failure", - { action => "administer flag types" }); + || ThrowUserError("auth_failure", {group => "editcomponents", + action => "edit", + object => "flagtypes"}); # Suppress "used only once" warnings. use vars qw(@legal_product @legal_components %components); diff --git a/mozilla/webtools/bugzilla/editgroups.cgi b/mozilla/webtools/bugzilla/editgroups.cgi index bc22d518e1e..3eca512f947 100755 --- a/mozilla/webtools/bugzilla/editgroups.cgi +++ b/mozilla/webtools/bugzilla/editgroups.cgi @@ -40,7 +40,10 @@ Bugzilla->login(LOGIN_REQUIRED); print Bugzilla->cgi->header(); -ThrowUserError("auth_cant_edit_groups") unless UserInGroup("creategroups"); +UserInGroup("creategroups") + || ThrowUserError("auth_failure", {group => "creategroups", + action => "edit", + object => "groups"}); my $action = trim($cgi->param('action') || ''); diff --git a/mozilla/webtools/bugzilla/editkeywords.cgi b/mozilla/webtools/bugzilla/editkeywords.cgi index d46476dfa88..9c835e8b777 100755 --- a/mozilla/webtools/bugzilla/editkeywords.cgi +++ b/mozilla/webtools/bugzilla/editkeywords.cgi @@ -58,11 +58,10 @@ Bugzilla->login(LOGIN_REQUIRED); print Bugzilla->cgi->header(); -unless (UserInGroup("editkeywords")) { - ThrowUserError("keyword_access_denied"); - exit; -} - +UserInGroup("editkeywords") + || ThrowUserError("auth_failure", {group => "editkeywords", + action => "edit", + object => "keywords"}); my $action = trim($cgi->param('action') || ''); $vars->{'action'} = $action; diff --git a/mozilla/webtools/bugzilla/editmilestones.cgi b/mozilla/webtools/bugzilla/editmilestones.cgi index ad07b2d61b9..1603851045e 100755 --- a/mozilla/webtools/bugzilla/editmilestones.cgi +++ b/mozilla/webtools/bugzilla/editmilestones.cgi @@ -125,11 +125,10 @@ Bugzilla->login(LOGIN_REQUIRED); print Bugzilla->cgi->header(); -unless (UserInGroup("editcomponents")) { - ThrowUserError('auth_cant_edit_milestones'); - exit; -} - +UserInGroup("editcomponents") + || ThrowUserError("auth_failure", {group => "editcomponents", + action => "edit", + object => "milestones"}); # # often used variables diff --git a/mozilla/webtools/bugzilla/editparams.cgi b/mozilla/webtools/bugzilla/editparams.cgi index 8ffd76a08ef..5d7ff9178e3 100755 --- a/mozilla/webtools/bugzilla/editparams.cgi +++ b/mozilla/webtools/bugzilla/editparams.cgi @@ -34,14 +34,10 @@ Bugzilla->login(LOGIN_REQUIRED); print Bugzilla->cgi->header(); -if (!UserInGroup("tweakparams")) { - print "