Update auth_helper.rb

This commit is contained in:
2017-03-23 05:14:47 -04:00
committed by GitHub
parent 85b40bc9cf
commit 3eaff0ab30

View File

@@ -17,13 +17,16 @@ module AuthHelper
end
end
def permission_checker(permission_list)
proc {
flag = false
permission_list.each { |permission|
flag ||= User.current.allowed_to_globally?(permission, {})
}
flag
def global_allowed_to?(user, action)
return false if user.nil?
projects = Project.all
projects.each { |p|
if user.allowed_to?(action, p)
return true
end
}
false
end
end