Project

General

Profile

Actions

Defect #36593

closed

User without permissions to view required project custom fields cannot create new projects

Added by Yazan Al aeddin over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Projects
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Hello
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.
https://github.com/redmine/redmine/pull/135


Files

redmine.PNG (110 KB) redmine.PNG Yazan Al aeddin, 2022-02-09 14:36
Actions #1

Updated by Mizuki ISHIKAWA over 2 years ago

+1
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.
Issue: https://github.com/redmine/redmine/blob/eb868ad9324e65942e8ad0ccd0a035d801a93864/app/models/issue.rb#L833

Actions #2

Updated by Vincent Robert over 2 years ago

  • Category set to Projects
  • Status changed from New to Confirmed
  • Target version set to Candidate for next minor release
Actions #3

Updated by Marius BĂLTEANU over 2 years ago

  • Assignee set to Marius BĂLTEANU
Actions #4

Updated by Marius BĂLTEANU over 2 years ago

  • Subject changed from unexpected behavior when a user create a project with required custom field to Unexpected behavior when a user create a project with required custom field
  • Target version changed from Candidate for next minor release to 4.1.7
Actions #5

Updated by Marius BĂLTEANU over 2 years ago

  • Status changed from Confirmed to Resolved

Fix committed, thanks!

Actions #6

Updated by Marius BĂLTEANU over 2 years ago

  • Subject changed from Unexpected behavior when a user create a project with required custom field to User without permissions to view required project custom fields cannot create new projects
  • Status changed from Resolved to Closed
  • Resolution set to Fixed
Actions

Also available in: Atom PDF