XF 2.3 Having trouble with permissions

Matt C.

Well-known member
Would someone mind taking a look at this for me? I feel like I'm losing my mind, because this should not be this difficult. Probably something really simple I'm overlooking:

I can't get these permission checks to resolve. I've double checked everything.

Code:
public function actionIndex(\XF\Mvc\ParameterBag $params)
{
    $visitor = \XF::visitor();

        if (!$visitor->hasPermission('mc_vgrc', 'view')) {
            return $this->error(\XF::phrase('mc_vgrc_you_dont_have_permission_to_view_the_release_calendar'));
        }

        $viewParams = [
            'canDownload' => $visitor->hasPermission('mc_vgrc', 'download'),
        ];

        return $this->view('MC\VGReleaseCalendar:Calendar', 'mc_vgrc_index', $viewParams);
    }

Screenshot 2025-09-06 at 16-42-03 Permissions XenForo - Admin control panel.webp

No matter what, page comes back with the permission error.

Thank you.
 
Last edited:
Fixed the issue, code was perfectly fine. I had a 3rd party add-on installed that prevented permissions from saving properly.
 
Back
Top Bottom