I just found out that <g:link>
was overwritten and it was made only to create the links if the logged in user has access to that link otherwise emit the body text. The code looks like:
def link = { attrs, body ->
def url = "/${pageScope.controllerName}/${attrs.action}"
if( !securityService.isLoggedIn() ||
securityService?.hasAccessToUri("/${pageScope.controllerName}/${attrs.action}") ) {
def originalTagBean = grailsApplication.mainContext.getBean('org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib')
originalTagBean.link.call(attrs, body)
} else {
out << body()
}
}