Skip to content

Commit

Permalink
perm check
Browse files Browse the repository at this point in the history
  • Loading branch information
Zbigniew Lukasiak committed Feb 12, 2012
1 parent fdb30a8 commit f7e7317
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/Nblog/Controller/User.pm
Expand Up @@ -38,6 +38,9 @@ sub index_action {

sub edit_action {
my $self = shift;
if( !$self->env->{user} || !( $self->env->{user}->id == $self->user->id ) ){
return $self->app->renderer->render( template => \"You have no access to this part of the site", c => $self );
}
my $params = $self->req->parameters->as_hashref_mixed;
my $form = Nblog::Form::BaseUser->new(
params => $params,
Expand Down
2 changes: 1 addition & 1 deletion share/templates/User/index.tt
Expand Up @@ -10,4 +10,4 @@
<div class="post-content">
[% c.user.formatted_about_me %]
</div>

<a href="[% c.user.username %]/edit">Edit</a>

0 comments on commit f7e7317

Please sign in to comment.