Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV: Change anonymous_posting_min_trust_level to a group-based setting #24072

Merged
merged 3 commits into from Oct 25, 2023

Conversation

martin-brennan
Copy link
Contributor

@martin-brennan martin-brennan commented Oct 24, 2023

No plugins or themes rely on anonymous_posting_min_trust_level so we
can just switch straight over to anonymous_posting_allowed_groups

This also adds an AUTO_GROUPS const which can be imported in JS
tests which is analogous to the one defined in group.rb. This can be used
to set the current user's groups where JS tests call for checking these groups
against site settings.

Finally a AtLeastOneGroupValidator validator is added for group_list site
settings which ensures that at least one group is always selected, since if
you want to allow all users to use a feature in this way you can just use
the everyone group.

@martin-brennan martin-brennan force-pushed the dev/rename-tl-group-settings-1 branch 2 times, most recently from e2e6dc3 to a9ca5a1 Compare October 24, 2023 04:45
No plugins or themes rely on anonymous_posting_min_trust_level so we
can just switch straight over to anonymous_posting_allowed_groups
@github-actions github-actions bot added the chat PRs which include a change to Chat plugin label Oct 25, 2023
@martin-brennan
Copy link
Contributor Author

@tgxworld ready for another round please

result.merge(
group_name => {
id: group_id,
automatic: true,
Copy link
Contributor

@tgxworld tgxworld Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small one but I wonder about the value of including this attribute considering that it will always be true and the constant name reflects that all groups are automatic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just because these will be used in tests to simulate actual groups on the user model, and this is how they are represented, since they can be mixed in with non-automatic groups.

@tgxworld
Copy link
Contributor

Changes look good to me 👍

@martin-brennan martin-brennan merged commit 9db4eaa into main Oct 25, 2023
13 checks passed
@martin-brennan martin-brennan deleted the dev/rename-tl-group-settings-1 branch October 25, 2023 01:45
@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/trust-level-permissions-table-inc-moderator-roles/224824/57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chat PRs which include a change to Chat plugin
3 participants