DEV: Update Guardian#is_developer to only require admin for Developer (#28396)

In development mode and when a developer's email is configured as part
of `Rails.configuration.developer_emails`, the user can be trusted and
should not be required to be an admin user.
This commit is contained in:
Alan Guo Xiang Tan 2024-08-19 13:46:28 +08:00 committed by GitHub
parent 31a6d24053
commit e1c4cf2566
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -155,9 +155,9 @@ class Guardian
end
def is_developer?
@user && is_admin? &&
@user &&
(
Rails.env.development? || Developer.user_ids.include?(@user.id) ||
Rails.env.development? || (is_admin? && Developer.user_ids.include?(@user.id)) ||
(
Rails.configuration.respond_to?(:developer_emails) &&
Rails.configuration.developer_emails.include?(@user.email)