Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2019
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. environments {
  2. development {
  3.  
  4. /*IF LOGIN 'ADMIN' - SHOULD CONNECT USING THIS
  5. dataSource {
  6. username = 'admin'
  7. password = 'Guard1an'
  8. url = "jdbc:jtds:sqlserver://test1:1433;
  9. MVCC=TRUE"
  10. dbCreate = 'update'
  11. }
  12. /*IF LOGIN 'USER' - SHOULD CONNECT USING THIS*/
  13.  
  14. dataSource {
  15. dbCreate = "update" // one of 'create', 'create-drop','update'
  16. username = 'user'
  17. password = 'tesoyear'
  18. url = "jdbc:jtds:sqlserver://test1:1433;
  19. }
  20. dataSource_wldb1 {
  21. username = 'gdx'
  22. password = 'pinoil'
  23. url = "jdbc:jtds:sqlserver://wldb:1433/IVR_GUARDIAN"
  24. dbCreate = 'update'
  25. }
  26. }
  27.  
  28. class SecurityFilters {
  29. def filters = {
  30. loginCheck(controller: 'load', action: '*') {
  31. before = {
  32. if (!session.user && !actionName.equals('login')) {
  33. flash.message = "User is not Logged in.Please login "
  34. redirect(controller:'user', action: 'index')
  35. return false
  36. }
  37. }
  38. }
  39.  
  40. }
  41. }
  42.  
  43. package org.example
  44.  
  45. import grails.plugins.springsecurity.Secured
  46.  
  47. class PostController {
  48.  
  49. @Secured(['ROLE_USER'])
  50. def followAjax = { ... }
  51.  
  52. @Secured(['ROLE_USER', 'IS_AUTHENTICATED_FULLY'])
  53. def addPostAjax = { ... }
  54.  
  55. def global = { ... }
  56.  
  57. @Secured(['ROLE_USER'])
  58. def timeline = { ... }
  59.  
  60. @Secured(['IS_AUTHENTICATED_REMEMBERED'])
  61. def personal = { ... }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement