diff --git a/pom.xml b/pom.xml
index 0dcf5d2..8db2f29 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
org.gcube.common
common-authorization
- 2.0.2-SNAPSHOT
+ 2.1.1-SNAPSHOT
authorization service common library
@@ -17,7 +17,7 @@
-
+
org.gcube.core
common-scope
[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)
@@ -33,6 +33,11 @@
4.11
test
+
+ org.aspectj
+ aspectjrt
+ 1.8.2
+
org.slf4j
slf4j-api
@@ -41,7 +46,62 @@
+
+
+
+ org.eclipse.m2e
+ lifecycle-mapping
+ 1.0.0
+
+
+
+
+
+ org.codehaus.mojo
+ aspectj-maven-plugin
+ [1.0,)
+
+ test-compile
+ compile
+
+
+
+
+
+
+
+
+
+
+
+ org.codehaus.mojo
+ aspectj-maven-plugin
+ 1.7
+
+ 1.7
+
+ 1.7
+
+
+
+
+ compile
+
+
+
+
+
+
+
+
+ org.codehaus.mojo
+ aspectj-maven-plugin
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
org.apache.maven.plugins
maven-resources-plugin
diff --git a/src/main/java/org/gcube/common/authorization/library/aspect/AuthorizationAspect.java b/src/main/java/org/gcube/common/authorization/library/aspect/AuthorizationAspect.java
new file mode 100644
index 0000000..018b6ea
--- /dev/null
+++ b/src/main/java/org/gcube/common/authorization/library/aspect/AuthorizationAspect.java
@@ -0,0 +1,36 @@
+
+package org.gcube.common.authorization.library.aspect;
+
+import java.lang.reflect.Method;
+
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.gcube.common.authorization.library.annotations.AuthorizationControl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Aspect
+public class AuthorizationAspect {
+
+ Logger log = LoggerFactory.getLogger(AuthorizationAspect.class);
+
+ @Pointcut("@annotation(org.gcube.common.authorization.library.annotations.AuthorizationControl)")
+ public void authorizationEntyPoint() {
+ }
+
+ @Pointcut("execution(* *(..))")
+ public void atExecution() {
+ }
+
+ @Before("authorizationEntyPoint() && atExecution()")
+ public void before(JoinPoint joinPoint) {
+ MethodSignature signature = (MethodSignature) joinPoint.getSignature();
+ Method method = signature.getMethod();
+ AuthorizationControl authAnn = (AuthorizationControl) method.getAnnotation(AuthorizationControl.class);
+ log.info("aspect before with annotation {} and value {} in method {}", authAnn.annotationType(), authAnn.check(), method.getName());
+ }
+
+}
diff --git a/src/main/resources/gcube.authorization b/src/main/resources/gcube.authorization
index a0918cc..abc8979 100644
--- a/src/main/resources/gcube.authorization
+++ b/src/main/resources/gcube.authorization
@@ -1 +1 @@
-node7.d.d4science.research-infrastructures.eufalse9000
\ No newline at end of file
+auth-d.dev.d4science.orgtrue443
\ No newline at end of file