/[transports]/trunk/lib/Transports/Model/Source.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/Transports/Model/Source.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 51 - (show annotations)
Mon Jun 5 14:06:58 2006 UTC (17 years, 11 months ago) by dpavlin
File size: 883 byte(s)
added landscapes (collection of source and destination clients) to the mix
instead of specifing users for sources (and destinations which wasn't
implemented anyway)
1 use strict;
2 use warnings;
3
4 package Transports::Model::Source::Schema;
5 use Jifty::DBI::Schema;
6
7 use Transports::Model::Landscape;
8
9 # Your column definitions go here. See L<Jifty::DBI::Schema> for
10 # documentation about how to write column definitions.
11
12 column name =>
13 type is 'text',
14 label is 'Source client',
15 is mandatory,
16 since '0.0.6';
17
18 column landscape =>
19 refers_to Transports::Model::Landscape,
20 label is 'Part of landscape',
21 since '0.0.13';
22
23 package Transports::Model::Source;
24 use base qw/Transports::Record/;
25
26 # Your model-specific methods go here.
27
28 =head2 current_user_can ACTION
29
30 Everybody can read, admin and import can everything else.
31
32 =cut
33
34 sub current_user_can {
35 my $self = shift;
36 my $type = shift;
37
38 return 1 if ($type eq 'read' || $self->current_user->admin || $self->current_user->can_import);
39
40 return $self->SUPER::current_user_can($type, @_);
41 }
42
43 1;
44

  ViewVC Help
Powered by ViewVC 1.1.26