[Jifty-commit] r3117 - jifty/trunk/lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed Apr 11 11:50:42 EDT 2007


Author: evdb
Date: Wed Apr 11 11:50:41 2007
New Revision: 3117

Modified:
   jifty/trunk/lib/Jifty/CurrentUser.pm

Log:
Allow '->superuser' to be both an object and class method.


Modified: jifty/trunk/lib/Jifty/CurrentUser.pm
==============================================================================
--- jifty/trunk/lib/Jifty/CurrentUser.pm	(original)
+++ jifty/trunk/lib/Jifty/CurrentUser.pm	Wed Apr 11 11:50:41 2007
@@ -65,12 +65,13 @@
 =head2 superuser
 
 A convenience constructor that returns a new CurrentUser object that's
-marked as a superuser.
+marked as a superuser. Can be called either as a class or object method.
 
 =cut
 
 sub superuser {
     my $class = shift;
+    $class = ref( $class ) if ref $class;
     my $self = $class->new();
     $self->is_superuser(1);
     return $self;


More information about the Jifty-commit mailing list