? <div>
{permission.description}
<div className="alert alert-warning spacer-top">
- {translate('projects_role', permission.key, 'public_projects_warning')}
+ {translate('projects_role.public_projects_warning')}
</div>
</div>
: permission.description);
selectedPermission={this.state.selectedPermission}
users={allUsers}
groups={this.state.groups}
+ showPublicProjectsWarning={true}
onSelectPermission={this.handleSelectPermission}
onToggleUser={this.handleToggleUser}
onToggleGroup={this.handleToggleGroup}>
users: React.PropTypes.array.isRequired,
groups: React.PropTypes.array.isRequired,
selectedPermission: React.PropTypes.string,
+ showPublicProjectsWarning: React.PropTypes.bool,
onSelectPermission: React.PropTypes.func.isRequired,
onToggleUser: React.PropTypes.func.isRequired,
onToggleGroup: React.PropTypes.func.isRequired
};
+ static defaultProps = {
+ showPublicProjectsWarning: false
+ };
+
handlePermissionClick = event => {
event.preventDefault();
event.currentTarget.blur();
};
renderTooltip = permission =>
- (permission.key === 'user' || permission.key === 'codeviewer'
+ (this.props.showPublicProjectsWarning &&
+ (permission.key === 'user' || permission.key === 'codeviewer')
? <div>
{permission.description}
<div className="alert alert-warning spacer-top">
- {translate('projects_role', permission.key, 'public_projects_warning')}
+ {translate('projects_role.public_projects_warning')}
</div>
</div>
: permission.description);
projects_role.issueadmin.desc=Perform advanced editing on issues: marking an issue False Positive / Won't Fix, and changing an Issue's severity. (Users will also need "Browse" permission)
projects_role.user=Browse
projects_role.user.desc=Access a project, browse its measures, and create/edit issues for it.
-projects_role.user.public_projects_warning=This option is not editable for public projects. Anyone will still be able to browse even if you apply a template with this option unchecked.
projects_role.codeviewer=See Source Code
projects_role.codeviewer.desc=View the project's source code. (Users will also need "Browse" permission)
-projects_role.codeviewer.public_projects_warning=This option is not editable for public projects. Source code will will always be visible even if you apply a template with this option unchecked.
projects_role.scan=Execute Analysis
projects_role.scan.desc=Ability to get all settings required to perform an analysis (including the secured settings like passwords) and to push analysis results to the SonarQube server.
projects_role.bulk_change=Bulk Change
projects_role.turn_project_to_public=Turn Project to Public
projects_role.are_you_sure_to_turn_project_to_public=Are you sure you want to turn your project to public?
projects_role.are_you_sure_to_turn_project_to_public.2=Everybody will be able to browse and see the source code of your project.
+projects_role.public_projects_warning=This permission is always granted by default to everybody (anonymous or authenticated user) for public projects. Therefore, the selection made on this page will be applied to private projects only.