mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Separated 'trusted users can edit others' setting for trust level 3 & 4 (#21493)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SeparateTrustedUsersCanEditOthersSiteSetting < ActiveRecord::Migration[7.0]
|
||||
def up
|
||||
if select_value(
|
||||
"SELECT 1 FROM site_settings WHERE name = 'trusted_users_can_edit_others' AND value = 'f'",
|
||||
)
|
||||
execute <<~SQL
|
||||
INSERT INTO site_settings (name, data_type, value, created_at, updated_at) VALUES ('edit_all_topic_groups', 20, '', now(), now());
|
||||
INSERT INTO site_settings (name, data_type, value, created_at, updated_at) VALUES ('edit_all_post_groups', 20, '', now(), now());
|
||||
SQL
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
execute <<~SQL
|
||||
DELETE FROM site_settings WHERE name = 'edit_all_topic_groups';
|
||||
DELETE FROM site_settings WHERE name = 'edit_all_post_groups';
|
||||
SQL
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user