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
|
|
@ -193,7 +193,7 @@ sub www_edit {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_mySubscriptions {
|
||||
my $self = shift;
|
||||
return $self->session->privilege->insufficient unless ($self->canView && $self->session->user->userId ne "1");
|
||||
return $self->session->privilege->insufficient unless ($self->canView && $self->session->user->isRegistered);
|
||||
my %var = ();
|
||||
my $meta = $self->getMetaDataFields;
|
||||
my @categories = ();
|
||||
|
|
@ -233,7 +233,7 @@ sub www_mySubscriptions {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_mySubscriptionsSave {
|
||||
my $self = shift;
|
||||
return $self->session->privilege->insufficient unless ($self->canView && $self->session->user->userId ne "1");
|
||||
return $self->session->privilege->insufficient unless ($self->canView && $self->session->user->isRegistered);
|
||||
my $subscriptions = $self->session->form->process("subscriptions", "checkList");
|
||||
$self->setUserSubscriptions($subscriptions);
|
||||
return $self->www_view;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue