19 |
is mandatory, |
is mandatory, |
20 |
is distinct; |
is distinct; |
21 |
|
|
22 |
column password =>, |
column password => |
23 |
type is 'text', |
type is 'text', |
24 |
label is 'Password', |
label is 'Password', |
25 |
is mandatory, |
is mandatory, |
26 |
render_as 'password'; |
render_as 'password'; |
27 |
|
|
28 |
|
column admin => |
29 |
|
type is 'boolean', |
30 |
|
label is 'Administrator', |
31 |
|
is mandatory, |
32 |
|
default is 'false', |
33 |
|
since '0.0.8'; |
34 |
|
|
35 |
package Transports::Model::User; |
package Transports::Model::User; |
36 |
use base qw/Transports::Record/; |
use base qw/Transports::Record/; |
37 |
|
|
78 |
sub current_user_can { |
sub current_user_can { |
79 |
my $self = shift; |
my $self = shift; |
80 |
my $right = shift; |
my $right = shift; |
81 |
|
|
82 |
|
warn 'no $self->id' unless ($self->id); |
83 |
|
|
84 |
my %args = (@_); |
my %args = (@_); |
85 |
#Carp::confess if ($right eq 'read' and not $args{'column'}); |
#Carp::confess if ($right eq 'read' and not $args{'column'}); |
86 |
if ( $right eq 'read' |
if ( $right eq 'read' |