Fixed generic permission model to redirect to login page if anonymous user was not granted access
This commit is contained in:
parent
b3a85c5998
commit
3e32e976db
3 changed files with 10 additions and 5 deletions
|
@ -83,6 +83,10 @@ HopObject.prototype.onRequest = function() {
|
|||
}
|
||||
|
||||
if (!this.getPermission(req.action)) {
|
||||
if (!session.user) {
|
||||
res.message = gettext("Please login first.");
|
||||
res.redirect(res.handlers.site.members.href("login"));
|
||||
}
|
||||
res.status = 401;
|
||||
res.write(gettext("Sorry, you are not allowed to access this part of the site."));
|
||||
res.stop();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue