themotte / rDrama

This code runs https://www.themotte.org. Forked from https://github.com/Aevann1/rDrama
GNU Affero General Public License v3.0
25 stars 30 forks source link

fix: filtered posts on frontpage listing #632

Closed TLSM closed 1 year ago

TLSM commented 1 year ago

Desired behavior for new posts when FilterNewPosts setting is enabled is that people with admin_level >= 2 and post authors should see their post on the frontpage, while all other unprivileged users shouldn't.

The logic for this is already in files.helpers.listing but it was overridden by a second filter condition which required state_mod = VISIBLE.

(state_mod = VISIBLE | author_id = v.id) & (state_mod = VISIBLE) simplifies in an unfortunate way. The latter condition was also not conditional on admin_level. Simply removing it fixes the listing for both post authors and privileged users.