Add collaborator now handles role, added macaron-contrib/binding for binding and validation

This commit is contained in:
Torkel Ödegaard
2015-01-16 11:54:19 +01:00
parent cd5843e977
commit f858f6b621
11 changed files with 81 additions and 75 deletions
+4 -4
View File
@@ -49,10 +49,10 @@ func AddToken(c *middleware.Context) {
return
}
if cmd.Role != m.ROLE_READ_WRITE && cmd.Role != m.ROLE_READ {
c.JsonApiErr(400, "Invalid role specified", nil)
return
}
// if cmd.Role != m.ROLE_READ_WRITE && cmd.Role != m.ROLE_READ {
// c.JsonApiErr(400, "Invalid role specified", nil)
// return
// }
cmd.AccountId = c.Account.Id
cmd.Token = util.GetRandomString(64)