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

FIX: Allow wiki and post_type revisions on staff alias user post. #27

Merged
merged 1 commit into from
Jan 25, 2022

Conversation

tgxworld
Copy link
Contributor

Previously, a user that is allowed to post as a staff alias user would
not be able to change the post type or wiki status of the post. This
commit fixes that by automatically revising the post as the staff alias
user if the user making the revision is allowed to post as a staff alias
user.

before do
SiteSetting.set(:staff_alias_allowed_groups, Group::AUTO_GROUPS[:staff].to_s)
SiteSetting.set(:staff_alias_username, 'staff_alias_user')
SiteSetting.set(:staff_alias_enabled, true)
Copy link
Contributor

@nattsw nattsw Jan 24, 2022

Choose a reason for hiding this comment

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

Do we need to have tests that reset enabled or with varying site settings?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I've added a test case that changes staff_alias_allowed_groups.

Previously, a user that is allowed to post as a staff alias user would
not be able to change the post type or wiki status of the post. This
commit fixes that by automatically revising the post as the staff alias
user if the user making the revision is allowed to post as a staff alias
user.
@tgxworld tgxworld merged commit 73dffcd into main Jan 25, 2022
@tgxworld tgxworld deleted the allow_more_revision branch January 25, 2022 04:55
@tgxworld
Copy link
Contributor Author

Thank you for reviewing @nattsw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants