FIX: Return 404 if API access is invalid.

This commit is contained in:
Guo Xiang Tan
2017-08-10 18:27:01 +09:00
parent b84e87dedd
commit f7d3702454
2 changed files with 11 additions and 0 deletions

View File

@@ -5,6 +5,8 @@ class StaffConstraint
def matches?(request)
provider = Discourse.current_user_provider.new(request.env)
provider.current_user && provider.current_user.staff?
rescue Discourse::InvalidAccess
false
end
end