mirror of
https://github.com/discourse/discourse.git
synced 2025-02-06 03:18:23 +00:00
Extensibility for custom staff check
This commit is contained in:
parent
6aef8f9cd9
commit
a8f211bd41
@ -4,9 +4,17 @@ class StaffConstraint
|
||||
|
||||
def matches?(request)
|
||||
provider = Discourse.current_user_provider.new(request.env)
|
||||
provider.current_user && provider.current_user.staff?
|
||||
provider.current_user &&
|
||||
provider.current_user.staff? &&
|
||||
custom_staff_check(request)
|
||||
rescue Discourse::InvalidAccess
|
||||
false
|
||||
end
|
||||
|
||||
# Extensibility point: plugins can overwrite this to add additional checks
|
||||
# if they require.
|
||||
def custom_staff_check(request)
|
||||
true
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user