From 455ab8384cc8a33be25c1a90087aca2673b96b69 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Tue, 23 Mar 2010 15:52:16 -0400 Subject: Bug 544332 - New bug_check_can_change_field hook for Bugzilla/Bug.pm r/a=mkanat --- Bugzilla/Hook.pm | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'Bugzilla/Hook.pm') diff --git a/Bugzilla/Hook.pm b/Bugzilla/Hook.pm index a5be1d38d..af73814ce 100644 --- a/Bugzilla/Hook.pm +++ b/Bugzilla/Hook.pm @@ -249,6 +249,66 @@ C<$changes-E{field} = [old, new]> =back +=head2 bug_check_can_change_field + +This hook controls what fields users are allowed to change. You can add code here for +site-specific policy changes and other customizations. This hook is only +executed if the field's new and old values differ. Any denies take priority over any allows. +So, if another extension denies a change but yours allows the change, the other extension's +deny will override your extension's allow. + +Params: + +=over + +=item C + +L - The current bug object that this field is changing on. + +=item C + +The name (from the C table) of the field that we are checking. + +=item C + +The new value that the field is being changed to. + +=item C + +The old value that the field is being changed from. + +=item C + +C - This is how you explicitly allow or deny a change. You should only +push something into this array if you want to explicitly allow or explicitly +deny the change, and thus skip all other permission checks that would otherwise +happen after this hook is called. If you don't care about the field change, +then don't push anything into the array. + +The pushed value should be a choice from the following constants: + +=over + +=item C + +No privileges required. This explicitly B a change. + +=item C + +User is not the reporter, assignee or an empowered user, so B. + +=item C + +User is not the assignee or an empowered user, so B. + +=item C + +User is not a sufficiently empowered user, so B. + +=back + +=back + =head2 bug_fields Allows the addition of database fields from the bugs table to the standard -- cgit v1.2.3-24-g4f1b