Jaxel Well-known member Dec 6, 2017 #1 I'm trying to display a navigation item only when a user has specific permissions... I've tried the following, but getting errors: Code: {{ $visitor->hasPermission('EWRrio', 'submitChannel') }}
I'm trying to display a navigation item only when a user has specific permissions... I've tried the following, but getting errors: Code: {{ $visitor->hasPermission('EWRrio', 'submitChannel') }}
Liam W in memoriam 1998-2020 Dec 6, 2017 #2 PHP: {{ $xf.visitor->hasPermission('EWRrio', 'submitChannel') }} Liam
robdog Well-known member Nov 15, 2018 #4 Anyone getting an error calling this in a template? I have extended my user class object and for some reason I can not get this to work. I keep getting: Code: Method hasPermisssion is not callable on the given object Last edited: Nov 15, 2018
Anyone getting an error calling this in a template? I have extended my user class object and for some reason I can not get this to work. I keep getting: Code: Method hasPermisssion is not callable on the given object
Mike XenForo developer Staff member Nov 15, 2018 #5 It means that the method isn't callable -- is_callable is failing on it. It does appear to be an object, but either the method doesn't exist or it isn't "visible". At a guess, I'd say you're trying to call it on the wrong variable.
It means that the method isn't callable -- is_callable is failing on it. It does appear to be an object, but either the method doesn't exist or it isn't "visible". At a guess, I'd say you're trying to call it on the wrong variable.