Added isVisitor, isAdmin, and isRegistered methods to User object instead
of hard coding checks everywhere with group ids. And updated the code base to match.
This commit is contained in:
parent
586164d8d0
commit
ef120fb06b
52 changed files with 201 additions and 118 deletions
|
|
@ -321,7 +321,7 @@ Generates an edit form.
|
|||
sub www_edit {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
return $session->privilege->insufficient() unless $session->user->isInGroup(3);
|
||||
return $session->privilege->insufficient() unless $session->user->isAdmin;
|
||||
my $admin = WebGUI::Shop::Admin->new($session);
|
||||
my $i18n = WebGUI::International->new($session, "Shop");
|
||||
my $form = $self->getEditForm;
|
||||
|
|
@ -340,7 +340,7 @@ Saves the data from the post.
|
|||
sub www_editSave {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
return $session->privilege->insufficient() unless $session->user->isInGroup(3);
|
||||
return $session->privilege->insufficient() unless $session->user->isAdmin;
|
||||
$self->processPropertiesFromFormPost;
|
||||
$session->http->setRedirect($session->url->page('shop=ship;method=manage'));
|
||||
return undef;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue