added check_permission

This commit is contained in:
2017-03-23 05:33:58 -04:00
committed by GitHub
parent ca17807117
commit 894ee9abfd

View File

@@ -25,6 +25,12 @@ module AuthHelper
false false
end end
def check_permission(permission)
if !allowed_to?(permission)
render :file => "public/401.html.erb", :status => :unauthorized, :layout =>true
end
end
def global_allowed_to?( action) def global_allowed_to?( action)
return false if User.current.nil? return false if User.current.nil?