Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- environments {
- development {
- /*IF LOGIN 'ADMIN' - SHOULD CONNECT USING THIS
- dataSource {
- username = 'admin'
- password = 'Guard1an'
- url = "jdbc:jtds:sqlserver://test1:1433;
- MVCC=TRUE"
- dbCreate = 'update'
- }
- /*IF LOGIN 'USER' - SHOULD CONNECT USING THIS*/
- dataSource {
- dbCreate = "update" // one of 'create', 'create-drop','update'
- username = 'user'
- password = 'tesoyear'
- url = "jdbc:jtds:sqlserver://test1:1433;
- }
- dataSource_wldb1 {
- username = 'gdx'
- password = 'pinoil'
- url = "jdbc:jtds:sqlserver://wldb:1433/IVR_GUARDIAN"
- dbCreate = 'update'
- }
- }
- class SecurityFilters {
- def filters = {
- loginCheck(controller: 'load', action: '*') {
- before = {
- if (!session.user && !actionName.equals('login')) {
- flash.message = "User is not Logged in.Please login "
- redirect(controller:'user', action: 'index')
- return false
- }
- }
- }
- }
- }
- package org.example
- import grails.plugins.springsecurity.Secured
- class PostController {
- @Secured(['ROLE_USER'])
- def followAjax = { ... }
- @Secured(['ROLE_USER', 'IS_AUTHENTICATED_FULLY'])
- def addPostAjax = { ... }
- def global = { ... }
- @Secured(['ROLE_USER'])
- def timeline = { ... }
- @Secured(['IS_AUTHENTICATED_REMEMBERED'])
- def personal = { ... }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement