I am trying to use the commentable plugin with Spring Security.
I can’t manage to write the right
grails.commentable.poster.evaluator
I tried {User.get(springSecurityService.principal.id)},
but from the CommentController, both User and springSecurity seems unaccessible.
What should I do?
For
springSecurityService.principal.idsince there’s no dependency injection field forspringSecurityServiceit can’t work, so you need to call whatspringSecurityService.principal.idcalls –org.springframework.security.core.context.SecurityContextHolder.context.authentication.principal.idTo fix the problem with User, you’ll need the full class name with package. So combined, this should be