OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
simplify code
ulferts06334ea33a75
diff --git a/app/services/authorization/user_allowed_service.rb b/app/services/authorization/user_allowed_service.rbindex 7480028051b..4b8138e73c9 100644--- a/app/services/authorization/user_allowed_service.rb+++ b/app/services/authorization/user_allowed_service.rb@@ -93,10 +93,9 @@ class Authorization::UserAllowedServicehas_authorized_role?(action, project)end+ # Authorize if user is authorized on every element of the arraydef allowed_to_in_all_projects?(action, projects)- projects = projects.to_a- # Authorize if user is authorized on every element of the array- projects.present? && projects.all? do |project|+ Array(projects).all? do |project|allowed_to?(action, project)endend@@ -140,7 +139,7 @@ class Authorization::UserAllowedServicedef normalize_action(action)if action.is_a?(Hash) && action[:controller] && action[:controller].to_s.starts_with?('/')action = action.dup- action[:controller] = action[:controller][1..-1]+ action[:controller] = action[:controller][1..]endaction