Comment obtenir current_user en utilisant le Printemps de Sécurité Graal plugin dans le SPG

Je suis novice dans le Graal. Je suis à l'aide de Printemps de Sécurité Graal plugin à des fins d'Authentification. Je veux obtenir de l'utilisateur courant dans mon point de vue gsp fichier.

Je suis comme ça ...

<g:if test="${post.author == Person.get(springSecurityService.principal.id).id }">
      <g:link controller="post" action="edit" id="${post.id}">
            Edit this post
      </g:link>
</g:if>

Ici, je veux montrer Éditer ce post lien uniquement les articles qui créé par signed_in de l'utilisateur. Mais Il montre l'ERREUR -

Error 500: Internal Server Error

 URI
    /groovypublish/post/list
 Class
   java.lang.NullPointerException
 Message
   Cannot get property 'principal' on null object

Voici mon Post.groovy --

class Post {

static hasMany = [comments:Comment]

String title
String teaser
String content
Date lastUpdated
Boolean published = false
SortedSet comments
Person author

....... more code ....

Voici ma Personne.groovy Domaine de Fichier de Classe --

class Person {

transient springSecurityService

String realName
String username
String password
boolean enabled
boolean accountExpired
boolean accountLocked
boolean passwordExpired
byte[] avatar
String avatarType

static hasMany = [followed:Person, posts:Post]
static searchable = [only: 'realName']
    ........ more code ......

S'il vous plaît aider.

OriginalL'auteur Free-Minded | 2013-07-08