XF 2.2 Permission problem

fionix

Well-known member
I have two moderators on the forum, both are in the user group REGISTERED(2) and MODERATING (4) - I have set all permission for them so they can moderate stuff.

However, some functionality does not work unless I also tick Administrative (3)

Got instant I made a Widget and followed the instructions in a thread to enter the following in Display conditions:
$xf.visitor.isMemberOf([3, 4])

If I not TICK Administrative the widget does not show up!

In explanation would be much appreciated.
 
I know you said you have them in the moderators group.. but depending on what functions are being offered, do they have that level of authorization to see whatever it is you are wanting to show? To create moderators, in addition to setting them in the moderators group, you usually need to specifically set them as a moderator (the same as you do administrators).

Screen Shot 2023-08-30 at 3.27.37 AM.png

But if the widget is based strictly upon user groups.. then it should be showing up without any issue.... unless you have something else (like an add-on?) interfereing.
 
I made them MOD aready as you show there, but still they have troubles from time to time with some of the functions. I don't remember them all right now but will bring them to the table once I find them.
 
I made them MOD aready as you show there, but still they have troubles from time to time with some of the functions.
Note when you add new add-ons to the site that have moderation capability, you usually have to go back into that moderators setting in that area and grant them moderator permissions for those add-ons. I'm playing with an add-on right now trying to figure out a use case for it, but my account did NOT have the necessary moderator settings to allow me to do certain things with it.
It's not simply "make 'em a moderator and they get all permissions for everything".... so it may be something to check.
This is an example of my moderator account.. you can see one box is not checked and the rest are..

Screen Shot 2023-08-30 at 2.54.51 PM.png
 
Thanks for the replies, but all this is very clear to me..

But if I set a MODERATOR as the following:

Registered user
Moderating
Go to the Group Permission and assign the same user as Moderator AND
go to the Widget and TICK permission for user group Moderating, then it should show up or not ?
 
Go to the Group Permission and assign the same user as Moderator AND
go to the Widget and TICK permission for user group Moderating, then it should show up or not ?
Barring any caching.... can you give an example of the templating code you are using to control this?
The issue COULD be, is this a global (super) moderator, or is this a moderator for specific node(s)?
 
Last edited:
The Entire template / Theme is from Theme House custom made, not sure what you mean?

Is this a built in template or a custom one... if it is a default XF template, you can't edit the template code easily. If it's a TH style created one... you need to contact them for support.

Try this for the display code
{{$xf.visitor.isMemberOf([3, 4])}} and see if that works.
Only works in templates... so that doesn't work.

You said you "Created a widget"... well, if you "created" one... you HAD to use some templating in the page node or in an add-on you created to get it to display... they don't simply work automagically to display what you want.
Have you checked that page node template to see if it may be excluding the moderator group?
 
Last edited:
Well, I think you are confusing something here. All displays fine with the above code and if I put Administrative rights to the users. That is the entire problem.
 
Well, I think you are confusing something here. All displays fine with the above code and if I put Administrative rights to the users. That is the entire problem.
No... I think you aren't quite grasping what I'm saying.
ALL widgets have some templates. You specifically stated it was that you "made" a widget.... making a widget requires using templating structure to get data to display, unless you use an existing widget.
If you actually DID "create" a new widget, have you checked that templating data you used to make sure that there aren't any "exclusionary statements" or "inclusive only" statements made?

And that "Administrative rights displays fine" is my exact point... IF you don't have any inclusive/exclusive statements in your widget template, then it should work. IF you have them, then it won't.

Did you simply use an existing widget as a "new" widget, or did you actually create a widget and then are calling the data in a page node?

I'd be happy to take a look at it later tonight (I stay up at night doing astro captures). I'm about to head off to bed.
 
Top Bottom