MissingMethodException in Grails with springSecurity

I need to bring the user in session but brings me null, if there is someone when in session

      groovy.lang.MissingMethodException: No signature of method:
      general.Evento.findByAllAsistentes() is applicable for argument types:(general.Usuario) values: [null]

Now try it with .currentUser, and also with the .principal but I do not find it ...

    //def user = springSecurityService.currentUser
    def user = Usuario.get(springSecurityService.principal.id)
    log.debug "User: ${user}" // Not found, it prints null

    Evento event = Evento.get(params.id)

     if(!event.findByAllAsistentes(user)){
                log.debug "Asistent to Event"
            }

I need your help, please

Upvotes: 0

Views: 122

Answers (1)

ataylor
ataylor

Reputation: 66099

findByAllAsistentes should probably be findAllByAsistentes, unless your Evento domain object has a property called allAsistentes.

Upvotes: 3

Related Questions