• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 2.0 Permission problem

Snog

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

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.png

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:

Snog

Well-known member
#2
I just discovered if I set the permission at the user group level, it works.

So, node level permissions are where the problem is.
 

Chris D

XenForo developer
Staff member
#3
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.