title: error creating a custom tag library in Grails
body: <p>I was trying out a simple use of grails tag library. I created a simple tag library called isowner</p>
  
  <pre><code>class AuthTagLib {
  static defaultEncodeAs = 'html'
  
  def springSecurityService
  
  def isOwner = { attrs, body -&gt;
      def loggedInUser = springSecurityService.currentUser
      def owner = attrs?.owner
  
      if(loggedInUser?.id == owner?.id) {
          out &lt;&lt; body()
      }
  }}
  </code></pre>
  
  <p>Then tried using it with the gsp as :</p>
  
  <pre><code>&lt;g:isOwner owner="${leaveFormInstance.employee}"&gt;
                      &lt;g:link class="edit" action="edit" resource="${leaveFormInstance}"&gt;
                          &lt;g:message code="default.button.edit.label" default="Edit" /&gt;
                      &lt;/g:link&gt;
  &lt;/g:isOwner&gt;
  </code></pre>
  
  <p>Now it was supposed to take a user object as input and validate if user is the owner of the post.</p>
  
  <p>Now everything works fine but in the output html it displays the link as a text.
  <img src="https://i.stack.imgur.com/iKMHO.png" alt="enter image description here"></p>
  
  <p>I am new with this stuff and must be missing some basics can you help.</p>