Skip to content

Commit

Permalink
Merge pull request #375 from gschueler/feature/issue-327-api-token-ro…
Browse files Browse the repository at this point in the history
…les-column

Fix too-long value for api token roles, fixes #327
  • Loading branch information
gschueler committed Apr 24, 2013
2 parents 16e35f0 + 29d8c9f commit f81228a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ class UserController {
while(AuthToken.findByToken(newtoken) != null){
newtoken = genRandomString()
}
final userroles = request.subject?.getPrincipals(com.dtolabs.rundeck.core.authentication.Group.class).collect { it.name }
AuthToken token = new AuthToken(token:newtoken,authRoles: userroles.join(","),user:u)
AuthToken token = new AuthToken(token:newtoken, authRoles: 'api_token_group',user:u)

if(token.save()){
log.debug("GENERATE TOKEN ${newtoken} for User ${login} with roles: ${token.authRoles}")
Expand Down
3 changes: 3 additions & 0 deletions rundeckapp/grails-app/domain/rundeck/AuthToken.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ class AuthToken {
authRoles(nullable:false)
user(nullable:false)
}
static mapping = {
authRoles type: 'text'
}
}

0 comments on commit f81228a

Please sign in to comment.