Actions
Defect #38064
closedAvoid exception when adding a project without any givable roles defined
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