Lucio Lelii 2018-11-30 16:06:43 +00:00
parent 81f61fc510
commit ff434e0d28
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ public class AuthorizationAspect {
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.actions(), authAnn.allowed(), method.getName());
log.info("aspect before with annotation {} with action {}, allowed {} in method {}", authAnn.annotationType(), authAnn.actions(), authAnn.allowed(), method.getName());
String userId = AuthorizationProvider.instance.get().getClient().getId();
if (authAnn.allowed().length!=0 && !Arrays.asList(authAnn.allowed()).contains(userId))
throw new RuntimeException("user not allowed to call method "+method.getName());