[Jifty-commit] r1807 - jifty/trunk/t/TestApp/lib/TestApp
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Sun Aug 13 16:41:00 EDT 2006
Author: seanmil
Date: Sun Aug 13 16:40:59 2006
New Revision: 1807
Added:
jifty/trunk/t/TestApp/lib/TestApp/CurrentUser.pm
Log:
* Tests work better when all the pieces are there....
Added: jifty/trunk/t/TestApp/lib/TestApp/CurrentUser.pm
==============================================================================
--- (empty file)
+++ jifty/trunk/t/TestApp/lib/TestApp/CurrentUser.pm Sun Aug 13 16:40:59 2006
@@ -0,0 +1,32 @@
+package TestApp::CurrentUser;
+
+use warnings;
+use strict;
+
+use base qw/Jifty::CurrentUser/;
+
+use TestApp::Model::User;
+
+sub _init {
+ my $self = shift;
+ my %args = (@_);
+
+ if ( delete $args{'_bootstrap'} ) {
+ $self->is_bootstrap_user(1);
+ } elsif (keys %args) {
+ $self->user_object(TestApp::Model::User->new(current_user => $self));
+ $self->user_object->load_by_cols(%args);
+
+ # tasty users are superusers
+ if ( $self->user_object->tasty == 1 ) {
+ $self->is_superuser(1);
+ }
+ }
+ $self->SUPER::_init(%args);
+}
+
+sub current_user_can {
+ return 1;
+}
+
+1;
More information about the Jifty-commit
mailing list