/[A3C]/lib/A3C/DefaultACL.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 /lib/A3C/DefaultACL.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 70 - (show annotations)
Thu Apr 10 20:26:45 2008 UTC (11 years, 11 months ago) by dpavlin
File size: 530 byte(s)
added generic currnet_user_can implementation for models so that logged
users can actually see data :-)
1 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