Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example
- import grails.plugin.springsecurity.SpringSecurityUtils
- class PersonController {
- ...
- def update() {
- Person personInstance = Person.get(params.id)
- if (SpringSecurityUtils.ifAllGranted('ROLE_ADMIN') {
- bindData(personInstance, params) // exclude nothing
- } else {
- bindData(personInstance, params, [exclude: ['someSensitiveProperty', 'anotherProp']])
- }
- }
- ...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement