Created
April 26, 2017 18:21
-
-
Save AndrewShitsko/32c5a6f6d7ae4b52c7ef1a2c4961bcaf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mock.transaction.manager | |
import grails.transaction.Transactional | |
@Transactional | |
class UserService { | |
def roleService | |
def createUser(Map params) { | |
def user = new User(params) | |
if (!user.save()) { | |
return null | |
} | |
roleService.grantRole(user, Role.findByAuthority(params.role)) | |
user | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment