FIX: Don't raise error when admin access is invalid.

This commit is contained in:
Guo Xiang Tan 2016-12-05 17:36:45 +08:00
parent 37b256e7f2
commit 4b75ad5110
1 changed files with 2 additions and 0 deletions

View File

@ -10,6 +10,8 @@ class AdminConstraint
return false if @require_master && RailsMultisite::ConnectionManagement.current_db != "default"
provider = Discourse.current_user_provider.new(request.env)
provider.current_user && provider.current_user.admin?
rescue Discourse::InvalidAccess
false
end
end