/[SQLSession]/trunk/lib/SQLSession/Upgrade.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/lib/SQLSession/Upgrade.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 61 - (show annotations)
Thu Jan 25 19:05:04 2007 UTC (17 years, 2 months ago) by dpavlin
File size: 702 byte(s)
added columns owner and create_on for Query, some Upgrade code to create admin@example.com
user with admin and edit roles.
Added real current_user_can which is a bit more complicated whan minimal.
1 # Dobrica Pavlinusic, <dpavlin@rot13.org> 01/25/07 18:13:01 CET
2
3 use strict;
4 use warnings;
5
6 package SQLSession::Upgrade;
7
8 use Jifty::Upgrade;
9 use base qw/Jifty::Upgrade/;
10
11 my $system_user = SQLSession::CurrentUser->superuser;
12
13 =head2 0.0.5
14
15 Added user class, so create test userdkdkd
16
17 =cut
18
19 since '0.0.5' => sub {
20
21 my $u = SQLSession::Model::User->new( current_user => $system_user );
22 $u->create(
23 name => 'Administrator',
24 email => 'admin@example.com',
25 password => 'admin',
26 email_confirmed => 1,
27 );
28
29 my $r = SQLSession::Model::Role->new( current_user => $system_user );
30 $r->create(
31 user_id => $u->id,
32 role => 'admin',
33 );
34 $r->create(
35 user_id => $u->id,
36 role => 'edit',
37 );
38
39 };
40
41 1;

  ViewVC Help
Powered by ViewVC 1.1.26