]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4366 Add permission check for project/QG association management
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Tue, 25 Feb 2014 21:40:23 +0000 (22:40 +0100)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Tue, 25 Feb 2014 21:40:23 +0000 (22:40 +0100)
sonar-server/src/main/java/org/sonar/server/qualitygate/QualityGates.java

index 2c3a70de3963937e68b3a579185a4998abf1321a..599a13976e9cb4d0bf27c559603c13af366eb98b 100644 (file)
@@ -173,12 +173,14 @@ public class QualityGates {
   }
 
   public void associateProject(Long qGateId, Long projectId) {
+    checkPermission(UserSession.get());
     getNonNullQgate(qGateId);
     checkNonNullProject(projectId);
     propertiesDao.setProperty(new PropertyDto().setKey(SONAR_QUALITYGATE_PROPERTY).setResourceId(projectId).setValue(qGateId.toString()));
   }
 
   public void dissociateProject(Long qGateId, Long projectId) {
+    checkPermission(UserSession.get());
     getNonNullQgate(qGateId);
     checkNonNullProject(projectId);
     propertiesDao.deleteProjectProperty(SONAR_QUALITYGATE_PROPERTY, projectId);