ZLHysong
ZLHysong

Reputation: 189

Redirect on Permission Error Joomla 3

Issue

Accessing a page without permission gives the error message:

You do not have permission to view this resource. Please contact the Site Administrator.

However, it should instead redirect to /login

Upvotes: 1

Views: 120

Answers (1)

ZLHysong
ZLHysong

Reputation: 189

Joomla Solution

Set the permission of the given menu item to Registered, and anyone who is not will be redirected to your login page.

Code Solution:

If you want to break the rules and implement this with code, you can add the following code into your template:

if ($('.cAlert:contains("You do not have permission to view this resource.")').length) {
    window.location.href = "/login";
};

Upvotes: 1

Related Questions