User without permissions to view required project custom fields cannot create new projects
|Assignee:||Marius BALTEANU||% Done:|
On a project when a custom field is marked as mandatory but not visible for certain roles, users of these roles can no longer create a project.
Skip validation of required custom fields when creating a project if user does not have permissions to see those custom fields (#36593).
Patch by mathieu-mbru.
#1 Updated by Mizuki ISHIKAWA 6 months ago
Thanks for reporting the problem and for sharing the code.
I was able to reproduce the problem.
Here are the steps to reproduce the problem.
bundle exec rake db:fixtures:load
- Log in as admin user
- Custom fields » Projects » New custom field
- ✓ required
- ✓ to these roles only: Manager
- Log in as jsmith user
- New project => save
- The error message "Test cannot be blank" is displayed.
In https://github.com/redmine/redmine/pull/135 , a pull request is proposed to skip the validation of required custom fields when a user who does not have permission to see them tries to create a project.
The same mechanism is already implemented in Issue, so I think it's good to add this pull request code to Redmine.