mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
DEV: Add configurable? helper to Plugin::Instance (#21472)
This reapplies commit 3073e5cfb0721b3b8009963c5fc7f61d414db317, with a fix that makes sure that plugins can be looked up both by the name present in metadata and directory name.
This commit is contained in:
@ -259,10 +259,15 @@ class Admin::SiteSettingsController < Admin::AdminController
|
||||
end
|
||||
|
||||
def raise_access_hidden_setting(id)
|
||||
# note, as of Ruby 2.3 symbols are GC'd so this is considered safe
|
||||
if SiteSetting.hidden_settings.include?(id.to_sym)
|
||||
id = id.to_sym
|
||||
|
||||
if SiteSetting.hidden_settings.include?(id)
|
||||
raise Discourse::InvalidParameters, "You are not allowed to change hidden settings"
|
||||
end
|
||||
|
||||
if SiteSetting.plugins[id] && !Discourse.plugins_by_name[SiteSetting.plugins[id]].configurable?
|
||||
raise Discourse::InvalidParameters, "You are not allowed to change unconfigurable settings"
|
||||
end
|
||||
end
|
||||
|
||||
def tag_notification_level(id)
|
||||
|
Reference in New Issue
Block a user