mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-02-13 09:13:58 -05:00
Add flash error messages for forbidden access in permission checks
This commit is contained in:
@@ -13,6 +13,7 @@ module AuthHelper
|
|||||||
def require_user
|
def require_user
|
||||||
return unless session[:token].nil?
|
return unless session[:token].nil?
|
||||||
if !User.current.logged?
|
if !User.current.logged?
|
||||||
|
flash[:error] = t :notice_forbidden
|
||||||
render_403
|
render_403
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -27,6 +28,7 @@ module AuthHelper
|
|||||||
|
|
||||||
def check_permission(permission)
|
def check_permission(permission)
|
||||||
if !allowed_to?(permission)
|
if !allowed_to?(permission)
|
||||||
|
flash[:error] = t :notice_forbidden
|
||||||
render_403
|
render_403
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -34,6 +36,7 @@ module AuthHelper
|
|||||||
|
|
||||||
def global_check_permission(permission)
|
def global_check_permission(permission)
|
||||||
if !globaly_allowed_to?(permission)
|
if !globaly_allowed_to?(permission)
|
||||||
|
flash[:error] = t :notice_forbidden
|
||||||
render_403
|
render_403
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user