Add "approve new topics unless trust level" setting

I would like to be able to allow trust level 1 users to post responses to existing topics (both posts and replies) without moderation, while new topics should go to an approval queue.

Is this doable with the current settings? If not, would this be a feature request for an upcoming version or would it be something a plugin could/should do? (For example, could this be done by a simple customization that hides the new topic button for a certain user level?)

1개의 좋아요

It’s not a bad idea; we suppressed Reply as Linked Topic for TL0 users to make the topic page a bit less noisy, but that is less relevant now that Reply as Linked Topic is behind the link button on each post.

I don’t know that creating a new topic should be suppressed for TL1 users though.

1개의 좋아요

The goal (for my case) would be to review new topics before publishing. Suppressing New Topic button is not the right option, I take that back.

(Apologies for monopolizing this topic…)

I made some progress on this today. I added a second setting called “approve new topics unless trust level” to the Posting screen:

and then in /lib/new_post_manager.b I added the following check to self.user_needs_approval? :
(manager.args[:title].present? && user.trust_level < SiteSetting.approve_new_topics_unless_trust_level.to_i) ||

It seems to work well on my initial tests. And I think that having this as an independent setting makes sense; sites can even combine both settings (approval queue for all posts for TL0 users and approval queue of new topics for TL1 users, for example).

If this fits within the team’s plans, I would be honoured to submit a PR.

6개의 좋아요

Go for it! Just keep in mind we might not get around to reviewing it until early October as we’re about to embark on a team meetup.

1개의 좋아요

Thanks, already submitted and @zogstrip reviewed it quickly and recommended writing tests. I have not written a test before, so I am not sure if it is expected of me or someone else.

Here is the PR:
https://github.com/discourse/discourse/pull/4447

6개의 좋아요

I may be off base here.

I agree that rspec and qunit tests are a good thing to have, but I think that the type of “test” Régis meant here is a “conditional test”.

That is, the “OR - AND” logic should test for “fast” and “regex” in there somewhere.

The PR has been updated with ruby tests.

3개의 좋아요

PR is now merged, thanks team!

4개의 좋아요

저희 인스턴스에서 문제가 발생했습니다. 포럼이 막 시작되었고, 제가 신규 가입한 사용자의 신뢰 수준(trust level)을 4로 설정해 두었는데, 이 사용자들의 게시글이 계속 관리자 게시글 검토 대기열에 쌓이고 있습니다. 제가 뭘 잘못하고 있는지 모르겠습니다. 설정에서는 '신뢰 수준 1 미만 승인’이 1로 되어 있습니다.

@tshenry 님, 이 문제를 재현해 보실 수 있나요?

2개의 좋아요

이 주제에 대해 더 깊이 들어가기 전에, 다음 사이트 설정이 어떻게 구성되어 있는지 알려주실 수 있을까요?

  • approve unless trust level
  • approve new topics unless trust level
  • approve post count

또한, 카테고리별 승인 설정이 활성화되어 있지 않음을 확인해 주실 수 있을까요?

2개의 좋아요