Project

General

Profile

Actions

Defect #38064

closed

Avoid exception when adding a project without any givable roles defined

Added by Holger Just almost 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Project settings
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

Project.default_member_role might return nil if there is no default member role and no givable role at all.

In the safe_attribute definition of Project#enabled_module_names, we use the method's return value without checking this. The attached patch fixes this by using the safe navigation operator there (introduced in Ruby 2.3.0) and denying changing of the modules if the user is not an admin.


Files

Actions #1

Updated by Go MAEDA almost 2 years ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Target version changed from Candidate for next minor release to 4.2.10

Committed the patch. Thank you.

Actions #2

Updated by Go MAEDA over 1 year ago

  • Tracker changed from Patch to Defect
Actions

Also available in: Atom PDF