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
|
|
@ -160,7 +160,7 @@ Returns a message stating that the user does not have the privileges necessary t
|
|||
sub noAccess {
|
||||
my $self = shift;
|
||||
$self->session->http->setStatus("401", "No Access");
|
||||
if ($self->session->user->userId eq '1') {
|
||||
if ($self->session->user->isVisitor) {
|
||||
return WebGUI::Operation::Auth::www_auth($self->session, "init");
|
||||
} else {
|
||||
my $i18n = WebGUI::International->new($self->session);
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ return props[propName];
|
|||
<!--morehead-->
|
||||
';
|
||||
|
||||
if ($self->session->user->isInGroup(2) || $self->session->setting->get("preventProxyCache")) {
|
||||
if ($self->session->user->isRegistered || $self->session->setting->get("preventProxyCache")) {
|
||||
# This "triple incantation" panders to the delicate tastes of various browsers for reliable cache suppression.
|
||||
$var{'head.tags'} .= '
|
||||
<meta http-equiv="Pragma" content="no-cache" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue