Advertisement
Guest User

grails

a guest
Oct 25th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. package hu.szte.rf.socialnetwork
  2. /*
  3. * A domain-ben lehet hogy felül kell definiálni a gettereket de valahogy így kellene kinézni a domain elérésnek
  4. * controllerből.
  5. * Tuti hogy nem pontosan így de valami hasonló. Próbálkozzatok + google + dokumentáció + youtube + wiki
  6. * Sok sikert ;)
  7. */
  8.  
  9. import grails.plugin.springsecurity.annotation.Secured
  10.  
  11. @Secured(['ROLE_USER'])
  12. class HomeController {
  13. def springSecurityService
  14. def firstname = User.getFirstName()
  15. def index() {
  16. def cuser = springSecurityService.currentUser
  17. def user = User.findWhere(id: cuser.id)
  18. // do something with user.firstname
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement