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
Conversation
e2e6dc3
to
a9ca5a1
Compare
No plugins or themes rely on anonymous_posting_min_trust_level so we can just switch straight over to anonymous_posting_allowed_groups
a9ca5a1
to
720368e
Compare
app/assets/javascripts/discourse-common/addon/lib/auto-groups.js
Outdated
Show resolved
Hide resolved
app/assets/javascripts/discourse/app/components/user-menu/profile-tab-content.js
Outdated
Show resolved
Hide resolved
1219971
to
807af5a
Compare
@tgxworld ready for another round please |
result.merge( | ||
group_name => { | ||
id: group_id, | ||
automatic: true, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Changes look good to me 👍 |
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 |
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 JStests which is analogous to the one defined in
group.rb
. This can be usedto set the current user's groups where JS tests call for checking these groups
against site settings.
Finally a
AtLeastOneGroupValidator
validator is added forgroup_list
sitesettings 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.