Disabling Trust Level Hierarchy/Stacking


Is it possible to disable trust level stacking? For example, right now, any categories that are available to TL2 only, would show categories available to TL1s and TL2s. Any categories restricted to TL3 would also show categories available to TL1s and TL2s.

I have a particular use case for this. On my forum, in order to incentive users to post, I am making available two “past exam” categories Fall and Spring 2017 as samplers, available to TL1s. This “past exam” category serves as an exam testing tool that I feel will be quite valuable to users. I would like to make the remaining exam categories only available to TL2s and above, but greyed out so users could still see they exist. A thought that @tshenry proposed was to create dummy categories, available to TL1s, that are empty. We would name this something like “Fall 2016 (Locked)”. When users reach TL2, the real category “Fall 2016” would show, and ideally the dummy category would be hidden away. Unfortunately, with TL stacking, the dummy categories still show. So in my example above, both “Fall 2016 (Locked)” and “Fall 2016” both are viewable to the user.

If I could disable TL stacking, I think this would solve my problem. Thanks for any input.

1 Like

No, this is not currently possible.

1 Like

There isn’t a way to do it using Category Permissions, but you might be able to do it using a theme component to hide the categories.

Right now I’m not seeing a TL related class, but if someone can point to a good component to extend, you could in theory do it.

Maybe even the page load event would be enough for this… but in theory you could do something like

var currentUser = Discourse.User.current();
if (currentUser && currentUser.trust_level >= 2)
    $('.category-list tr[data-category-id="6"]').css('display', 'none'); //category page listing
    $('.category-drop li[data-value="6"]').css('display', 'none'); //category drop down selection

Again, all theory, haven’t had time to prove it, but I think it could be done, you just need it to fire that code at the right time.