Skip to content

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

Adjust the Project UpdateContract to check for edit_project_attributes only if there are changes

Dombi Attila361a96d7ccbb
diff --git a/app/contracts/projects/update_contract.rb b/app/contracts/projects/update_contract.rb
index 3468f50b547..7c067b7ea21 100644
--- a/app/contracts/projects/update_contract.rb
+++ b/app/contracts/projects/update_contract.rb
@@ -33,7 +33,7 @@ module Projects
def manage_permission
if changed_by_user == ["active"]
:archive_project
- elsif changed_by_user.all? { |c| c.match(/^custom_field_/) }
+ elsif changed_by_user.any? && changed_by_user.all? { |c| c.match(/^custom_field_/) }
:edit_project_attributes
else
# if "active" is changed, :archive_project permission will also be