Added basic gradle configuration

parent 46f0aae8
subprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
sourceCompatibility = 1.7
version = '0.50.0-SNAPSHOT'
springVersion = '4.0.+'
springSecurityVersion = '3.2.+'
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
compile group: 'org.springframework', name: 'spring-context', version: springVersion
compile group: 'org.springframework.security', name: 'spring-security-config', version: springSecurityVersion
testCompile group: 'junit', name: 'junit', version: '4.+'
testCompile group: 'org.springframework', name: 'spring-test', version: springVersion
}
test {
systemProperties 'property': 'value'
}
}
\ No newline at end of file
apply plugin: 'eclipse-wtp'
apply plugin: 'war'
jar {
manifest {
attributes 'Implementation-Title': 'Connector-Service', 'Implementation-Version': version
}
}
repositories {
mavenCentral()
}
dependencies {
compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
compile group: 'org.springframework', name: 'spring-context', version: springVersion
compile group: 'org.springframework', name: 'spring-webmvc', version: springVersion
compile group: 'org.springframework', name: 'spring-jdbc', version: springVersion
compile group: 'org.springframework', name: 'spring-tx', version: springVersion
compile group: 'org.springframework.security', name: 'spring-security-web', version: springSecurityVersion
compile group: 'org.springframework.security', name: 'spring-security-config', version: springSecurityVersion
compile group: 'org.springframework.security', name: 'spring-security-ldap', version: springSecurityVersion
compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.+'
compile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.0+'
compile group: 'org.codehaus.jackson', name: 'jackson-mapper-lgpl', version: '1.9+'
compile group: 'org.hsqldb', name: 'hsqldb', version: '2.2+'
compile group: 'cglib', name: 'cglib', version: '3.0+'
compile group: 'de.thm.arsnova.connector', name: 'connector-model', version: '0.+'
compile group: 'de.thm.arsnova.connector', name: 'connector-client', version: '0.+'
testCompile group: 'junit', name: 'junit', version: '4.+'
testCompile group: 'org.mockito', name: 'mockito-core', version: '1.9.+'
testCompile group: 'org.dbunit', name: 'dbunit', version: '2.4.+'
}
test {
systemProperties 'property': 'value'
}
uploadArchives {
repositories {
flatDir {
dirs 'repos'
}
}
}
\ No newline at end of file
......@@ -28,7 +28,7 @@ public class RepoPermissionEvaluator implements PermissionEvaluator {
}
/** Checks permission
*
*
*/
@Override
public boolean hasPermission(Authentication authentication, Serializable targetId, String targetType, Object permission) {
......@@ -60,7 +60,7 @@ public class RepoPermissionEvaluator implements PermissionEvaluator {
Membership membership = client.getMembership(ud.getUsername(), "undefined");
if ("read".equals(permission) && ud.getUsername().equals(targetId) && membership.isMember() ) {
if ("read".equals(permission) && ud.getUsername().equals(targetId) ) {
return true;
}
break;
......
......@@ -17,7 +17,7 @@ import org.springframework.http.MediaType;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.GrantedAuthorityImpl;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
......@@ -49,7 +49,7 @@ public class WebDomainIntegrationTest {
@Test
public void testShouldReturnMembership() throws Exception {
List<GrantedAuthority> ga = new ArrayList<GrantedAuthority>();
ga.add(new GrantedAuthorityImpl("ADMIN"));
ga.add(new SimpleGrantedAuthority("ADMIN"));
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken("admin", "secret", ga);
SecurityContextHolder.getContext().setAuthentication(token);
mockMvc.perform(get("/test/membership/42").accept(MediaType.APPLICATION_JSON))
......@@ -77,7 +77,7 @@ public class WebDomainIntegrationTest {
@Test
public void testShouldReturnCourses() throws Exception {
List<GrantedAuthority> ga = new ArrayList<GrantedAuthority>();
ga.add(new GrantedAuthorityImpl("ADMIN"));
ga.add(new SimpleGrantedAuthority("ADMIN"));
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken("admin", "secret", ga);
SecurityContextHolder.getContext().setAuthentication(token);
mockMvc.perform(get("/test/courses").accept(MediaType.APPLICATION_JSON))
......
include "connector-model", "connector-client", "connector-service"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment