From 816a30397da6ceff836d8723233dc5cdbda70871 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 21 Nov 2017 13:08:32 -0600 Subject: Role refactor (#7867) * role refactor * add missing file * fix web test --- app/user.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/user.go') diff --git a/app/user.go b/app/user.go index a17521d9f..b94c2a9fb 100644 --- a/app/user.go +++ b/app/user.go @@ -179,7 +179,7 @@ func (a *App) CreateUser(user *model.User) (*model.User, *model.AppError) { return nil, model.NewAppError("CreateUser", "api.user.create_user.accepted_domain.app_error", nil, "", http.StatusBadRequest) } - user.Roles = model.ROLE_SYSTEM_USER.Id + user.Roles = model.SYSTEM_USER_ROLE_ID // Below is a special case where the first user in the entire // system is granted the system_admin role @@ -188,7 +188,7 @@ func (a *App) CreateUser(user *model.User) (*model.User, *model.AppError) { } else { count := result.Data.(int64) if count <= 0 { - user.Roles = model.ROLE_SYSTEM_ADMIN.Id + " " + model.ROLE_SYSTEM_USER.Id + user.Roles = model.SYSTEM_ADMIN_ROLE_ID + " " + model.SYSTEM_USER_ROLE_ID } } @@ -1235,7 +1235,7 @@ func (a *App) UpdateUserRoles(userId string, newRoles string, sendWebSocketEvent func (a *App) PermanentDeleteUser(user *model.User) *model.AppError { l4g.Warn(utils.T("api.user.permanent_delete_user.attempting.warn"), user.Email, user.Id) - if user.IsInRole(model.ROLE_SYSTEM_ADMIN.Id) { + if user.IsInRole(model.SYSTEM_ADMIN_ROLE_ID) { l4g.Warn(utils.T("api.user.permanent_delete_user.system_admin.warn"), user.Email) } -- cgit v1.2.3-1-g7c22