In my spring application, the methods from my controller and service classes have this annotation to security purposes:
@PreAuthorize("hasPermission(#user, 'cadastra')")
the second argument, the permission, should have this format:
<<action_name>>_<<class_name>>
What expression I should use to accomplish that, taking in consideration the class name is held by this.getClass().getName()
?
@PreAuthorize("hasPermission(#user, 'cadastra_' + this.class.name)")
? – Alpenstock@PreAuthorize("hasPermission(#user, 'cadastra_#this.class.name')")
unsuccessfully. – Otes@PreAuthorize("hasPermission(#user,'cadastra_'+#this.class.name)")
– Defazio