aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenu.tsx
diff options
context:
space:
mode:
authorJeremy Davis <jeremy.davis@sonarsource.com>2021-03-24 16:22:53 +0100
committersonartech <sonartech@sonarsource.com>2021-04-15 20:03:44 +0000
commit83774f0672fe554b374128808b46c1a0abaca286 (patch)
tree3e6d2559418a817006162bb54fcebf70ff1d1412 /server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenu.tsx
parent8b518c6bccb19f5416991dd05b0924ddd0838526 (diff)
downloadsonarqube-83774f0672fe554b374128808b46c1a0abaca286.tar.gz
sonarqube-83774f0672fe554b374128808b46c1a0abaca286.zip
SONAR-14606 Plugins require risk acknowledgment
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenu.tsx')
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenu.tsx7
1 files changed, 3 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenu.tsx b/server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenu.tsx
index fb282ba3f49..d2c52c76eba 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenu.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/components/ProjectCreationMenu.tsx
@@ -27,6 +27,7 @@ import { withCurrentUser } from '../../../components/hoc/withCurrentUser';
import { IMPORT_COMPATIBLE_ALMS } from '../../../helpers/constants';
import { hasGlobalPermission } from '../../../helpers/users';
import { AlmKeys, AlmSettingsInstance } from '../../../types/alm-settings';
+import { Permissions } from '../../../types/permissions';
import ProjectCreationMenuItem from './ProjectCreationMenuItem';
interface Props {
@@ -38,8 +39,6 @@ interface State {
boundAlms: Array<string>;
}
-const PROJECT_CREATION_PERMISSION = 'provisioning';
-
const almSettingsValidators = {
[AlmKeys.Azure]: (settings: AlmSettingsInstance) => !!settings.url,
[AlmKeys.BitbucketServer]: (_: AlmSettingsInstance) => true,
@@ -68,7 +67,7 @@ export class ProjectCreationMenu extends React.PureComponent<Props, State> {
fetchAlmBindings = async () => {
const { currentUser } = this.props;
- const canCreateProject = hasGlobalPermission(currentUser, PROJECT_CREATION_PERMISSION);
+ const canCreateProject = hasGlobalPermission(currentUser, Permissions.ProjectCreation);
// getAlmSettings requires branchesEnabled
if (!canCreateProject) {
@@ -94,7 +93,7 @@ export class ProjectCreationMenu extends React.PureComponent<Props, State> {
const { className, currentUser } = this.props;
const { boundAlms } = this.state;
- const canCreateProject = hasGlobalPermission(currentUser, PROJECT_CREATION_PERMISSION);
+ const canCreateProject = hasGlobalPermission(currentUser, Permissions.ProjectCreation);
if (!canCreateProject) {
return null;