XF 2.1 Everyone can see the admin template.

Plueki

Member
Hi,

Im working on my custom addon and i have an issue.
If im not logged in on an administrator account, i still can see the admin template.
Can somebody take a look with me please?

This is the admin login page.
The login box disappears and this is what i see.
'Comming soon' is written in the admin template.
202507
202508
202509

this is my route
202510

My second page, same thing
202512
 
add something like this to your admin controller:
PHP:
    protected function preDispatchController($action, ParameterBag $params)
    {
        $this->assertAdminPermission('yourPermission');
    }
you have to add the appropriate permission at admin.php?admin-permissions/

Edit: But if you were extending \XF\Admin\Controller\AbstractController non-admin users would not have the view rights anyway.
 
Last edited:
add something like this to your admin controller:
PHP:
    protected function preDispatchController($action, ParameterBag $params)
    {
        $this->assertAdminPermission('yourPermission');
    }
you have to add the appropriate permission at admin.php?admin-permissions/

Edit: But if you were extending \XF\Admin\Controller\AbstractController non-admin users would not have the view rights anyway.

Hi!

I was looking for the solution of extending the admin AbstractController.
My class did extend an AbstractController just not the right one and i had no idea that admin had an own AbstractController.

Thank you very much!
 
Top Bottom