Parent Directory | Revision Log
added generic currnet_user_can implementation for models so that logged users can actually see data :-)
1 | dpavlin | 70 | package A3C::DefaultACL; |
2 | use Exporter 'import'; | ||
3 | our @EXPORT = qw/ | ||
4 | current_user_can | ||
5 | /; | ||
6 | |||
7 | use strict; | ||
8 | use warnings; | ||
9 | |||
10 | sub current_user_can { | ||
11 | my ( $self,$action,$item,$value ) = @_; | ||
12 | $item ||= ''; | ||
13 | $value ||= ''; | ||
14 | # Jifty->log->debug("|$action|$item|$value| user id: ",$self->current_user->id); | ||
15 | # return 0 if $self->current_user->id == 0 && $action ne 'read'; | ||
16 | return 1 if $self->current_user->superuser; | ||
17 | return 1 if $self->current_user->administrator; | ||
18 | return 1 if $action eq 'read' && $self->current_user->id > 0; | ||
19 | return 0; | ||
20 | } | ||
21 | |||
22 |
ViewVC Help | |
Powered by ViewVC 1.1.26 |