diff options
author | bbaetz%acm.org <> | 2008-04-17 20:26:12 +0200 |
---|---|---|
committer | bbaetz%acm.org <> | 2008-04-17 20:26:12 +0200 |
commit | 22ac4064da3f75f68df8bc939e6d5399f57a3ba8 (patch) | |
tree | 9ed8f59fbe364c2c4efc7c96c6e250e60126418a /Bugzilla/WebService.pm | |
parent | 32b928bab4ad3715e151bad7aa1609a2dc91266d (diff) | |
download | bugzilla-22ac4064da3f75f68df8bc939e6d5399f57a3ba8.tar.gz bugzilla-22ac4064da3f75f68df8bc939e6d5399f57a3ba8.tar.xz |
Bug 428941 â Allow extension webservices to override LOGIN_EXEMPT
r/a=mkanat
Diffstat (limited to 'Bugzilla/WebService.pm')
-rwxr-xr-x | Bugzilla/WebService.pm | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/Bugzilla/WebService.pm b/Bugzilla/WebService.pm index 72994cb65..a2313803d 100755 --- a/Bugzilla/WebService.pm +++ b/Bugzilla/WebService.pm @@ -42,10 +42,24 @@ sub datetime_format { } sub handle_login { - my ($self, $module, $method) = @_; - my $exempt = LOGIN_EXEMPT->{$module}; - return if $exempt && grep { $_ eq $method } @$exempt; + my ($classes, $action, $uri, $method) = @_; + + my $class = $classes->{$uri}; + eval "require $class"; + + return if $class->login_exempt($method); Bugzilla->login; + + return; +} + +# For some methods, we shouldn't call Bugzilla->login before we call them +use constant LOGIN_EXEMPT => { }; + +sub login_exempt { + my ($class, $method) = @_; + + return $class->LOGIN_EXEMPT->{$method}; } 1; |