XF 2.0 Permission problem

Snog

Well-known member
I have a custom permission (Create private thread) and it is set to 'Yes' for a specific forum node...
PermYes.webp

In the template I've tried to check it with both of these...
Code:
<xf:if is="{{ $xf.visitor.hasPermission('forum', 'snog_create_private') }}">

OR

<xf:if is="$xf.visitor.hasPermission('forum', 'snog_create_private')">
But, neither one works.

When I check the data at the template level (dump $xf.visitor), the permission combination is missing for the user...
nocombination.webp

This is in the forum_post_thread template, if that makes a difference.

The specific place it's being checked is immediately after
Code:
<xf:macro template="helper_thread_options" name="thread_status" arg-thread="{$thread}" />
 
Last edited:
I just discovered if I set the permission at the user group level, it works.

So, node level permissions are where the problem is.
 
Well, if you want to be checking a node permission, then you don't use the hasPermission method. You'd use the hasContentPermission method instead.
 
Top Bottom