Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- transient springSecurityService
- static belongsTo = [rol: Role]
- String username
- String password
- boolean enabled = true
- boolean accountExpired
- boolean accountLocked
- boolean passwordExpired
- static transients = ['springSecurityService']
- static constraints = {
- username blank: false, unique: true
- password blank: false
- }
- static mapping = {
- password column: '`password`'
- }
- Set<Role> getAuthorities() {
- UserRole.findAllByUser(this).collect { it.role } as Set
- }
- def beforeInsert() {
- encodePassword()
- }
- protected void encodePassword() {
- password = springSecurityService.encodePassword(password)
- }
- def beforeUpdate() {
- if (isDirty('password')) {
- encodePassword()
- }
- }
- static belongsTo = [taches: Tache,projet:Project,modules: Moduleee]
- static constraints = {
- }
- String toString() {
- "$username"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement