Permalink
Browse files

Start of ACLs

  • Loading branch information...
1 parent a830217 commit c0df115252d4b73edadf7cf1a2a3f7651b5120cb @nelhage committed Mar 25, 2007
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/AuthMitEdu/Model/User.pm
@@ -38,7 +38,19 @@ sub is_trusted {
sub name {return shift->username;}
-sub current_user_can {1};
+sub current_user_can {
+ my $self = shift;
+ my $right = shift;
+
+ return 1 if $right eq 'create';
+
+ if($right eq 'read') {
+ return 1;
+ } elsif($right eq 'write' && $self->id eq $self->current_user->id) {
+ return 1;
+ }
+ return $self->SUPER::current_user_can($right, @_);
+}
1;

0 comments on commit c0df115

Please sign in to comment.