Granular group-based permissions for anonymous and logged in users

No problem! Glad the disallowed_groups will be helpful. I’ve merged that PR now.

I need to take a pass through all our official themes & components now that we have disallowed_groups and resolve_group_memberships available, I suggest you and @moin do the same when you can for your own themes and components, as after I’ve made changes to our official repos I would really like to move forward with making the upcoming change from the OP stable .

There is a lot of other core work now relying on/using anonymous_users and logged_in_users and I’d really like to delete the everyone group.

2 Likes

hey Martin - question:

i just did a full update of my instance, and i am now adding the disallowed_groups object setting to my component for everyone and anonymous_users based on the auto group ids here:

like this:

      groups:
        type: groups
        disallowed_groups: "0|4"
        required: true
        resolve_group_membership: true
        validations:
          max: 20

but it is still showing everyone in the component group dropdown setting:

what am i doing wrong in the object setting? i notice that even without the disallowed_groups in the objects, it still doesn’t show the anonymous_users group (so at the moment, there is no difference between the list in my component whether i set disallowed_groups or not). i tested with other group ids and i must be doing something wrong with how i am using disallowed_groups (or syntax) because it doesn’t seem to have any effect regardless of which ones i use.

4 Likes

Oh there were some GitHub issues earlier in the day, so only just now has disallowed_groups change worked its way into latest Commits · discourse/discourse · GitHub

Not completely sure that will be the issue, but can you try updating again and see if it persists? If not LMK and point me to your theme component (or is it just your group sidebar one?) so I can debug :slight_smile:

1 Like

I think that was because the upcoming change was disabled on the forum you used for testing. I enabled it and now it’s visible.


I also updated the forum, and everyone and anonymous_users are hidden as expected.


To clarify: I’m the one who disabled the change about two weeks ago :innocent:

3 Likes

hah :smiley: thanks Moin! i actually forgot that the new granular group setting was in upcoming changes anyways.

Martin, the disallowed_groups object setting works perfectly. i really like this change. thanks again Team - great improvement. :discourse: :chefs_kiss:

3 Likes