From ec913a9462215a5d83b05bbc188f7e76d1416041 Mon Sep 17 00:00:00 2001 From: Antoine Vigneau Date: Fri, 20 Oct 2023 10:42:48 +0200 Subject: SONAR-20699 Local projects always apply permissions template --- .../java/org/sonar/db/project/CreationMethod.java | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'server/sonar-db-dao') diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/project/CreationMethod.java b/server/sonar-db-dao/src/main/java/org/sonar/db/project/CreationMethod.java index cc9d89b98b4..5f96e42f9e6 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/project/CreationMethod.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/project/CreationMethod.java @@ -22,20 +22,22 @@ package org.sonar.db.project; import java.util.Arrays; public enum CreationMethod { - UNKNOWN(Category.UNKNOWN, false), - LOCAL_API(Category.LOCAL, false), - LOCAL_BROWSER(Category.LOCAL, true), - ALM_IMPORT_API(Category.ALM_IMPORT, false), - ALM_IMPORT_BROWSER(Category.ALM_IMPORT, true), - SCANNER_API(Category.SCANNER, false), - SCANNER_API_DEVOPS_AUTO_CONFIG(Category.SCANNER, false); + UNKNOWN(Category.UNKNOWN, false, true), + LOCAL_API(Category.LOCAL, false, true), + LOCAL_BROWSER(Category.LOCAL, true, true), + ALM_IMPORT_API(Category.ALM_IMPORT, false, false), + ALM_IMPORT_BROWSER(Category.ALM_IMPORT, true, false), + SCANNER_API(Category.SCANNER, false, true), + SCANNER_API_DEVOPS_AUTO_CONFIG(Category.SCANNER, false, false); - private final boolean isCreatedViaBrowser; private final Category category; + private final boolean isCreatedViaBrowser; + private final boolean isLocal; - CreationMethod(Category category, boolean isCreatedViaBrowser) { + CreationMethod(Category category, boolean isCreatedViaBrowser, boolean isLocal) { this.isCreatedViaBrowser = isCreatedViaBrowser; this.category = category; + this.isLocal = isLocal; } public static CreationMethod getCreationMethod(Category category, boolean isBrowserCall) { @@ -54,5 +56,9 @@ public enum CreationMethod { return category; } + public boolean isLocal() { + return isLocal; + } + public enum Category {UNKNOWN, LOCAL, ALM_IMPORT, SCANNER} } -- cgit v1.2.3