Adding static roles
This commit is contained in:
parent
1b41ad660a
commit
5ab2296187
7
constants/role.go
Normal file
7
constants/role.go
Normal file
@ -0,0 +1,7 @@
|
||||
package constants
|
||||
|
||||
const (
|
||||
RoleOwner = iota
|
||||
RoleAdmin
|
||||
RoleUser
|
||||
)
|
@ -6,6 +6,7 @@ import (
|
||||
companydb "multitenantStack/services/companydb"
|
||||
"strings"
|
||||
|
||||
constants "multitenantStack/constants"
|
||||
tokenTools "multitenantStack/services/tokenTools"
|
||||
"time"
|
||||
|
||||
@ -230,7 +231,7 @@ func (c *AuthController) Register() {
|
||||
var companyUser models.CompanyUser
|
||||
companyUser.Name = username
|
||||
companyUser.Profile = "{}"
|
||||
companyUser.Role = 1 //TODO: replacxe with owner constant
|
||||
companyUser.Role = constants.RoleOwner
|
||||
|
||||
userID, err := models.AddCompanyUser(newO, &companyUser)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user