Log Message:
-----------
uh, hasPermissions() is a method, so it actually gets 3 arguments. print
the arguments received as part of the error message. TESTED THIS TIME!
Modified Files:
--------------
webwork2/lib:
WeBWorK.pm
webwork2/lib/WeBWorK:
Authz.pm
Revision Data
-------------
Index: WeBWorK.pm
===================================================================
RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK.pm,v
retrieving revision 1.74
retrieving revision 1.75
diff -Llib/WeBWorK.pm -Llib/WeBWorK.pm -u -r1.74 -r1.75
--- lib/WeBWorK.pm
+++ lib/WeBWorK.pm
@@ -234,7 +234,10 @@
debug("Now we deal with the effective user:\n");
my $eUserID = $r->param("effectiveUser") || $userID;
debug("userID=$userID eUserID=$eUserID\n");
- my $su_authorized = $authz->hasPermissions($userID, "become_student", $eUserID);
+ # FIXME: hasPermissions does nothing with $eUserID, and lately we want it to
+ # only accept two arguments, so we're removing $eUserID from this call.
+ #my $su_authorized = $authz->hasPermissions($userID, "become_student", $eUserID);
+ my $su_authorized = $authz->hasPermissions($userID, "become_student");
if ($su_authorized) {
debug("Ok, looks like you're allowed to become $eUserID. Whoopie!\n");
} else {
Index: Authz.pm
===================================================================
RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Authz.pm,v
retrieving revision 1.21
retrieving revision 1.22
diff -Llib/WeBWorK/Authz.pm -Llib/WeBWorK/Authz.pm -u -r1.21 -r1.22
--- lib/WeBWorK/Authz.pm
+++ lib/WeBWorK/Authz.pm
@@ -143,7 +143,11 @@
# This currently only uses two of it's arguments, but it accepts any number, in
# case in the future calculating certain permissions requires more information.
sub hasPermissions {
- die "hasPermissions called with != 2 arguments" unless @_ == 2;
+ if (@_ != 3) {
+ shift @_; # get rid of self
+ my $nargs = @_;
+ die "hasPermissions called with $nargs arguments instead of the expected 2: '@_'"
+ }
my ($self, $userID, $activity) = @_;
my $r = $self->{r};
|