diff --git a/archetype.plugin/src/main/resources/archetype-resources/pom.xml b/archetype.plugin/src/main/resources/archetype-resources/pom.xml
index 0572e705c9..00298945fa 100644
--- a/archetype.plugin/src/main/resources/archetype-resources/pom.xml
+++ b/archetype.plugin/src/main/resources/archetype-resources/pom.xml
@@ -37,6 +37,13 @@
commons.loader
1.0.31
+
+ com.pmease
+ commons.loader
+ 1.0.31
+ test-jar
+ test
+
diff --git a/commons.jetty/pom.xml b/commons.jetty/pom.xml
index dfa6b27744..f73e5bceb4 100644
--- a/commons.jetty/pom.xml
+++ b/commons.jetty/pom.xml
@@ -31,22 +31,18 @@
org.eclipse.jetty
jetty-server
- ${jettyVersion}
org.eclipse.jetty
jetty-servlets
- ${jettyVersion}
org.eclipse.jetty
jetty-servlet
- ${jettyVersion}
org.eclipse.jetty
jetty-websocket
- ${jettyVersion}
@@ -68,6 +64,5 @@
com.pmease.commons.jetty.JettyModule
- 8.1.10.v20130312
diff --git a/commons.loader/pom.xml b/commons.loader/pom.xml
index 65b5b1f808..47e419b354 100644
--- a/commons.loader/pom.xml
+++ b/commons.loader/pom.xml
@@ -1,77 +1,88 @@
-
- 4.0.0
- commons.loader
-
- com.pmease
- parent.general
- 1.0.31
-
-
-
-
- com.pmease
- plugin.maven
-
-
- maven-source-plugin
-
-
- maven-javadoc-plugin
-
-
-
-
-
- com.pmease
- commons.bootstrap
- 1.0.31
-
-
- com.pmease
- commons.util
- 1.0.31
-
-
- com.google.inject
- guice
- ${guiceVersion}
-
-
- com.google.inject.extensions
- guice-assistedinject
- ${guiceVersion}
-
-
- com.google.inject.extensions
- guice-servlet
- ${guiceVersion}
-
-
- com.google.inject.extensions
- guice-multibindings
- ${guiceVersion}
-
-
-
-
- pmeaseRepo
- PMEase Repository
-
- true
- never
- fail
-
-
- true
- always
- fail
-
- http://artifact.pmease.com/
-
-
-
- 4.0-beta
-
+
+ 4.0.0
+ commons.loader
+
+ com.pmease
+ parent.general
+ 1.0.31
+
+
+
+
+ com.pmease
+ plugin.maven
+
+
+ maven-source-plugin
+
+
+ maven-javadoc-plugin
+
+
+ maven-jar-plugin
+
+
+
+ test-jar
+
+
+
+
+
+
+
+
+ com.pmease
+ commons.bootstrap
+ 1.0.31
+
+
+ com.pmease
+ commons.util
+ 1.0.31
+
+
+ com.google.inject
+ guice
+ ${guiceVersion}
+
+
+ com.google.inject.extensions
+ guice-assistedinject
+ ${guiceVersion}
+
+
+ com.google.inject.extensions
+ guice-servlet
+ ${guiceVersion}
+
+
+ com.google.inject.extensions
+ guice-multibindings
+ ${guiceVersion}
+
+
+
+
+ pmeaseRepo
+ PMEase Repository
+
+ true
+ never
+ fail
+
+
+ true
+ always
+ fail
+
+ http://artifact.pmease.com/
+
+
+
+ 4.0-beta
+
diff --git a/commons.loader/src/main/java/com/pmease/commons/loader/AppLoaderMocker.java b/commons.loader/src/test/java/com/pmease/commons/loader/AppLoaderMocker.java
similarity index 100%
rename from commons.loader/src/main/java/com/pmease/commons/loader/AppLoaderMocker.java
rename to commons.loader/src/test/java/com/pmease/commons/loader/AppLoaderMocker.java
diff --git a/gitop.core/pom.xml b/gitop.core/pom.xml
index 3dc7b4667b..a41776af79 100644
--- a/gitop.core/pom.xml
+++ b/gitop.core/pom.xml
@@ -1,75 +1,83 @@
-
- 4.0.0
- gitop.core
-
- com.pmease
- parent.general
- 1.0.31
-
-
-
-
- com.pmease
- plugin.maven
-
-
- maven-archetype-plugin
-
-
- maven-source-plugin
-
-
- maven-javadoc-plugin
-
-
-
-
-
- com.pmease
- commons.loader
- 1.0.31
-
-
- com.pmease
- commons.shiro
- 1.0.30
-
-
- com.pmease
- commons.git
- 1.0.0
-
-
- com.pmease
- commons.editable
- 1.0.0
-
-
- com.pmease
- commons.jetty
- 1.0.31
-
-
-
-
- pmeaseRepo
- PMEase Repository
-
- true
- never
- fail
-
-
- true
- always
- fail
-
- http://artifact.pmease.com/
-
-
-
- com.pmease.gitop.core.CoreModule
-
+
+ 4.0.0
+ gitop.core
+
+ com.pmease
+ parent.general
+ 1.0.31
+
+
+
+
+ com.pmease
+ plugin.maven
+
+
+ maven-archetype-plugin
+
+
+ maven-source-plugin
+
+
+ maven-javadoc-plugin
+
+
+
+
+
+ com.pmease
+ commons.loader
+ 1.0.31
+
+
+ com.pmease
+ commons.shiro
+ 1.0.30
+
+
+ com.pmease
+ commons.git
+ 1.0.0
+
+
+ com.pmease
+ commons.editable
+ 1.0.0
+
+
+ com.pmease
+ commons.jetty
+ 1.0.31
+
+
+ com.pmease
+ commons.loader
+ 1.0.31
+ test-jar
+ test
+
+
+
+
+ pmeaseRepo
+ PMEase Repository
+
+ true
+ never
+ fail
+
+
+ true
+ always
+ fail
+
+ http://artifact.pmease.com/
+
+
+
+ com.pmease.gitop.core.CoreModule
+
diff --git a/gitop.core/src/main/java/com/pmease/gitop/core/model/Project.java b/gitop.core/src/main/java/com/pmease/gitop/core/model/Project.java
index b1d90060b5..10af183b27 100644
--- a/gitop.core/src/main/java/com/pmease/gitop/core/model/Project.java
+++ b/gitop.core/src/main/java/com/pmease/gitop/core/model/Project.java
@@ -20,7 +20,7 @@ import javax.validation.constraints.NotNull;
import com.pmease.commons.editable.annotation.Editable;
import com.pmease.commons.hibernate.AbstractEntity;
import com.pmease.gitop.core.Gitop;
-import com.pmease.gitop.core.gatekeeper.AlwaysAccept;
+import com.pmease.gitop.core.gatekeeper.ApprovedByAuthorizedUsers;
import com.pmease.gitop.core.gatekeeper.GateKeeper;
import com.pmease.gitop.core.manager.BranchManager;
import com.pmease.gitop.core.manager.UserManager;
@@ -62,7 +62,7 @@ public class Project extends AbstractEntity implements UserBelonging {
private GeneralOperation defaultAuthorizedOperation = GeneralOperation.NO_ACCESS;
@Column(nullable=false)
- private GateKeeper gateKeeper = new AlwaysAccept();
+ private GateKeeper gateKeeper = new ApprovedByAuthorizedUsers();
@Column(nullable=false)
private Date createdAt = new Date();
diff --git a/gitop.http/src/main/java/com/pmease/gitop/http/GitFilter.java b/gitop.http/src/main/java/com/pmease/gitop/http/GitFilter.java
index 149da4b89d..818fb7b996 100644
--- a/gitop.http/src/main/java/com/pmease/gitop/http/GitFilter.java
+++ b/gitop.http/src/main/java/com/pmease/gitop/http/GitFilter.java
@@ -109,7 +109,11 @@ public class GitFilter implements Filter {
}
git.upload().input(ServletUtils.getInputStream(request)).output(response.getOutputStream()).call();
} else {
- if (!SecurityUtils.getSubject().isPermitted(ObjectPermission.ofProjectWrite(project))) {
+ /*
+ * We intentionally use read permission here for write operation so that gate keeper gets the
+ * chance to run to possibly create a merge request for non-permitted user.
+ */
+ if (!SecurityUtils.getSubject().isPermitted(ObjectPermission.ofProjectRead(project))) {
throw new UnauthorizedException("You do not have permission to push to this project.");
}
git.receive().input(ServletUtils.getInputStream(request)).output(response.getOutputStream()).call();
@@ -143,7 +147,11 @@ public class GitFilter implements Filter {
writeInitial(response, service);
git.advertiseUploadRefs().output(response.getOutputStream()).call();
} else {
- if (!SecurityUtils.getSubject().isPermitted(ObjectPermission.ofProjectWrite(project))) {
+ /*
+ * We intentionally use read permission here for write operation so that gate keeper gets the
+ * chance to run to possibly create a merge request for non-permitted user.
+ */
+ if (!SecurityUtils.getSubject().isPermitted(ObjectPermission.ofProjectRead(project))) {
throw new UnauthorizedException("You do not have permission to push to this project.");
}
writeInitial(response, service);
diff --git a/parent.general/pom.xml b/parent.general/pom.xml
index fc1ef87a3f..3655b74011 100644
--- a/parent.general/pom.xml
+++ b/parent.general/pom.xml
@@ -1,403 +1,465 @@
-
- 4.0.0
- com.pmease
- parent.general
- 1.0.31
- pom
-
- 3.0
-
-
- ${project.groupId}.${project.artifactId}-${project.version}
-
-
- src/main/resources
- true
-
- archetype-resource/pom.xml
-
-
-
- src/main/resources
-
- archetype-resource/pom.xml
-
-
-
- src/main/java
-
- **/*.java
-
-
-
-
-
- src/test/resources
-
-
- src/test/java
-
- **/*.java
-
-
-
-
-
-
- org.eclipse.m2e
- lifecycle-mapping
- 1.0.0
-
-
-
-
-
- com.pmease
- plugin.maven
- [1.0.0,]
-
- check-project-dependencies
- generate-artifact-descriptor
- generate-plugin-resources
- generate-product-resources
- create-product-sandbox
- run-ant
-
-
-
-
- true
- true
-
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
- [1.0.0,]
-
- jar
-
-
-
-
-
-
-
-
-
-
-
- maven-compiler-plugin
-
- 1.7
- 1.7
-
-
-
- maven-archetype-plugin
- 2.2
-
-
- install-archetype
- install
-
- update-local-catalog
-
-
-
-
-
- maven-resources-plugin
- 2.5
-
- \
-
-
-
- maven-jar-plugin
- 2.4
-
-
- default-jar
- never
-
- unwanted
- unwanted
-
-
-
-
-
- maven-antrun-plugin
- 1.7
-
-
- ant
- ant-apache-regexp
- 1.6.5
-
-
- org.codehaus.groovy
- groovy-all
- 1.8.6
-
-
- org.codehaus.gant
- gant_groovy1.8
- 1.9.7
-
-
-
-
- com.pmease
- plugin.maven
- 1.0.31
-
-
- check-project-dependencies
- compile
-
- check-project-dependencies
-
-
-
- generate-artifact-descriptor
- compile
-
- generate-artifact-descriptor
-
-
-
- package-artifact
- package
-
- package-artifact
-
-
-
- generate-plugin-resources
- compile
-
- generate-plugin-resources
-
-
-
- generate-product-resources
- compile
-
- generate-product-resources
-
-
-
- create-product-sandbox
- compile
-
- create-product-sandbox
-
-
-
-
-
- maven-source-plugin
- 2.1.2
-
-
- attach-sources
- package
-
- jar-no-fork
-
-
-
-
-
- maven-javadoc-plugin
- 2.8.1
-
-
- attach-javadocs
- package
-
- jar
-
-
-
-
-
-
-
-
-
-
- org.slf4j
- slf4j-api
- ${slf4jVersion}
-
-
- org.slf4j
- jul-to-slf4j
- ${slf4jVersion}
-
-
- ch.qos.logback
- logback-core
- ${logbackVersion}
-
-
- ch.qos.logback
- logback-classic
- ${logbackVersion}
-
-
- org.apache.commons
- commons-lang3
- 3.1
-
-
- commons-codec
- commons-codec
- 1.7
-
-
- javax.servlet
- javax.servlet-api
- 3.1-b09
-
-
- commons-io
- commons-io
- 2.4
-
-
- com.google.code.findbugs
- jsr305
- 2.0.1
-
-
- com.google.guava
- guava
- 14.0.1
-
-
- org.quartz-scheduler
- quartz
- 2.1.7
-
-
- dom4j
- dom4j
- 1.6.1
-
-
- org.apache.velocity
- velocity
- 1.7
-
-
- commons-httpclient
- commons-httpclient
- 3.1
-
-
- joda-time
- joda-time
- 2.2
-
-
- commons-collections
- commons-collections
- 3.2.1
-
-
- org.javassist
- javassist
- 3.18.0-GA
-
-
- org.apache.ant
- ant
- 1.9.1
-
-
-
-
-
- junit
- junit
- 4.11
- test
-
-
- org.mockito
- mockito-all
- 1.9.5
- test
-
-
- org.powermock
- powermock-module-junit4
- ${powermockVersion}
- test
-
-
- org.powermock
- powermock-api-mockito
- ${powermockVersion}
- test
-
-
-
-
-
- true
- never
- fail
-
-
- true
- never
- fail
-
- pmeaseRepo
- PMEase Repository
- http://artifact.pmease.com/
-
-
-
-
- pmeaseRepo
- PMEase Repository
-
- true
- never
- fail
-
-
- true
- always
- fail
-
- http://artifact.pmease.com/
-
-
-
-
- pmeaseRepo
- http://artifact.pmease.com/
-
-
-
- UTF-8
- UTF-8
- 1.7.5
- 1.0.11
- 0.7.0-SNAPSHOT
- 1.17.1
- 2.2.3
- 1.5.1
-
+
+ 4.0.0
+ com.pmease
+ parent.general
+ 1.0.31
+ pom
+
+ 3.0
+
+
+ ${project.groupId}.${project.artifactId}-${project.version}
+
+
+ src/main/resources
+ true
+
+ archetype-resource/pom.xml
+
+
+
+ src/main/resources
+
+ archetype-resource/pom.xml
+
+
+
+ src/main/java
+
+ **/*.java
+
+
+
+
+
+ src/test/resources
+
+
+ src/test/java
+
+ **/*.java
+
+
+
+
+
+
+ org.eclipse.m2e
+ lifecycle-mapping
+ 1.0.0
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+ [1.0.0,)
+
+ enforce
+
+
+
+
+
+
+
+
+ com.pmease
+ plugin.maven
+ [1.0.0,]
+
+ check-project-dependencies
+ generate-artifact-descriptor
+ generate-plugin-resources
+ generate-product-resources
+ create-product-sandbox
+ run-ant
+
+
+
+
+ true
+ true
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ [1.0.0,]
+
+ jar
+
+
+
+
+
+
+
+
+
+
+
+ maven-compiler-plugin
+
+ 1.7
+ 1.7
+
+
+
+ maven-archetype-plugin
+ 2.2
+
+
+ install-archetype
+ install
+
+ update-local-catalog
+
+
+
+
+
+ maven-resources-plugin
+ 2.5
+
+ \
+
+
+
+ maven-jar-plugin
+ 2.4
+
+
+ default-jar
+ never
+
+ unwanted
+ unwanted
+
+
+
+
+
+ maven-antrun-plugin
+ 1.7
+
+
+ ant
+ ant-apache-regexp
+ 1.6.5
+
+
+ org.codehaus.groovy
+ groovy-all
+ 1.8.6
+
+
+ org.codehaus.gant
+ gant_groovy1.8
+ 1.9.7
+
+
+
+
+ com.pmease
+ plugin.maven
+ 1.0.31
+
+
+ check-project-dependencies
+ compile
+
+ check-project-dependencies
+
+
+
+ generate-artifact-descriptor
+ compile
+
+ generate-artifact-descriptor
+
+
+
+ package-artifact
+ package
+
+ package-artifact
+
+
+
+ generate-plugin-resources
+ compile
+
+ generate-plugin-resources
+
+
+
+ generate-product-resources
+ compile
+
+ generate-product-resources
+
+
+
+ create-product-sandbox
+ compile
+
+ create-product-sandbox
+
+
+
+
+
+ maven-source-plugin
+ 2.1.2
+
+
+ attach-sources
+ package
+
+ jar-no-fork
+
+
+
+
+
+ maven-javadoc-plugin
+ 2.8.1
+
+
+ attach-javadocs
+ package
+
+ jar
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+ 1.3.1
+
+
+ enforce-java
+
+ enforce
+
+
+
+
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+
+ org.slf4j
+ slf4j-api
+ ${slf4jVersion}
+
+
+ org.slf4j
+ jul-to-slf4j
+ ${slf4jVersion}
+
+
+ ch.qos.logback
+ logback-core
+ ${logbackVersion}
+
+
+ ch.qos.logback
+ logback-classic
+ ${logbackVersion}
+
+
+ org.apache.commons
+ commons-lang3
+ 3.1
+
+
+ commons-codec
+ commons-codec
+ 1.7
+
+
+ javax.servlet
+ javax.servlet-api
+ 3.1-b09
+
+
+ commons-io
+ commons-io
+ 2.4
+
+
+ com.google.code.findbugs
+ jsr305
+ 2.0.1
+
+
+ com.google.guava
+ guava
+ 14.0.1
+
+
+ org.quartz-scheduler
+ quartz
+ 2.1.7
+
+
+ dom4j
+ dom4j
+ 1.6.1
+
+
+ org.apache.velocity
+ velocity
+ 1.7
+
+
+ commons-httpclient
+ commons-httpclient
+ 3.1
+
+
+ joda-time
+ joda-time
+ 2.2
+
+
+ commons-collections
+ commons-collections
+ 3.2.1
+
+
+ org.javassist
+ javassist
+ 3.18.0-GA
+
+
+ org.apache.ant
+ ant
+ 1.9.1
+
+
+ org.eclipse.jetty
+ jetty-server
+ ${jettyVersion}
+
+
+ org.eclipse.jetty
+ jetty-servlets
+ ${jettyVersion}
+
+
+ org.eclipse.jetty
+ jetty-servlet
+ ${jettyVersion}
+
+
+ org.eclipse.jetty
+ jetty-websocket
+ ${jettyVersion}
+
+
+ org.eclipse.jetty
+ jetty-util
+ ${jettyVersion}
+
+
+
+
+
+ junit
+ junit
+ 4.11
+ test
+
+
+ org.mockito
+ mockito-all
+ 1.9.5
+ test
+
+
+ org.powermock
+ powermock-module-junit4
+ ${powermockVersion}
+ test
+
+
+ org.powermock
+ powermock-api-mockito
+ ${powermockVersion}
+ test
+
+
+
+
+
+ true
+ never
+ fail
+
+
+ true
+ never
+ fail
+
+ pmeaseRepo
+ PMEase Repository
+ http://artifact.pmease.com/
+
+
+
+
+ pmeaseRepo
+ PMEase Repository
+
+ true
+ never
+ fail
+
+
+ true
+ always
+ fail
+
+ http://artifact.pmease.com/
+
+
+
+
+ pmeaseRepo
+ http://artifact.pmease.com/
+
+
+
+ UTF-8
+ UTF-8
+ 1.7.5
+ 1.0.11
+ 0.7.0-SNAPSHOT
+ 1.17.1
+ 8.1.10.v20130312
+ 2.2.3
+ 1.5.1
+
diff --git a/plugin.maven/pom.xml b/plugin.maven/pom.xml
index 12962d8a86..509e7a790e 100644
--- a/plugin.maven/pom.xml
+++ b/plugin.maven/pom.xml
@@ -1,126 +1,173 @@
-
- 4.0.0
- com.pmease
- plugin.maven
- 1.0.31
- maven-plugin
-
- ${mavenVersion}
-
-
- ${project.groupId}.${project.artifactId}-${project.version}
-
-
-
- org.eclipse.m2e
- lifecycle-mapping
- 1.0.0
-
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
- [1.0.0,]
-
- jar
-
-
-
-
-
-
-
-
-
-
-
- maven-compiler-plugin
-
- 1.7
- 1.7
-
-
-
-
-
-
-
- org.apache.maven
- maven-plugin-api
- ${mavenVersion}
-
-
- org.apache.maven
- maven-artifact
- ${mavenVersion}
-
-
- org.apache.maven
- maven-model
- ${mavenVersion}
-
-
- org.apache.maven
- maven-core
- ${mavenVersion}
-
-
- org.apache.maven
- maven-archiver
- 2.5
-
-
- org.codehaus.plexus
- plexus-archiver
- 2.1.1
-
-
- org.codehaus.plexus
- plexus-utils
- 3.0
-
-
- org.codehaus.plexus
- plexus-io
- 2.0.4
-
-
- org.apache.maven.plugins
- maven-antrun-plugin
- 1.7
- true
-
-
-
-
- pmeaseRepo
- http://artifact.pmease.com/
-
-
-
-
- pmeaseRepo
- PMEase Repository
-
- true
- never
- fail
-
-
- true
- always
- fail
-
- http://artifact.pmease.com/
-
-
-
- 3.0
- UTF-8
- UTF-8
-
+
+ 4.0.0
+ com.pmease
+ plugin.maven
+ 1.0.31
+ maven-plugin
+
+ ${mavenVersion}
+
+
+ ${project.groupId}.${project.artifactId}-${project.version}
+
+
+
+ org.eclipse.m2e
+ lifecycle-mapping
+ 1.0.0
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ [1.0.0,]
+
+ jar
+
+
+
+
+
+
+
+
+
+
+
+ maven-compiler-plugin
+
+ 1.7
+ 1.7
+
+
+
+ org.eclipse.m2e
+ lifecycle-mapping
+ 1.0.0
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+ [1.0.0,)
+
+ enforce
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+ 1.3.1
+
+
+ enforce-java
+
+ enforce
+
+
+
+
+ 1.7.0
+
+
+
+
+
+
+
+
+
+
+ org.apache.maven
+ maven-plugin-api
+ ${mavenVersion}
+
+
+ org.apache.maven
+ maven-artifact
+ ${mavenVersion}
+
+
+ org.apache.maven
+ maven-model
+ ${mavenVersion}
+
+
+ org.apache.maven
+ maven-core
+ ${mavenVersion}
+
+
+ org.apache.maven
+ maven-archiver
+ 2.5
+
+
+ org.codehaus.plexus
+ plexus-archiver
+ 2.1.1
+
+
+ org.codehaus.plexus
+ plexus-utils
+ 3.0
+
+
+ org.codehaus.plexus
+ plexus-io
+ 2.0.4
+
+
+ org.apache.maven.plugins
+ maven-antrun-plugin
+ 1.7
+ true
+
+
+
+
+ pmeaseRepo
+ http://artifact.pmease.com/
+
+
+
+
+ pmeaseRepo
+ PMEase Repository
+
+ true
+ never
+ fail
+
+
+ true
+ always
+ fail
+
+ http://artifact.pmease.com/
+
+
+
+ 3.0
+ UTF-8
+ UTF-8
+