Skip to content

Commit

Permalink
update for older object model
Browse files Browse the repository at this point in the history
  • Loading branch information
sbishel committed Aug 17, 2023
1 parent 110d9d4 commit 85825cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/api/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"github.com/mattermost/focalboard/server/model"
"github.com/mattermost/focalboard/server/services/audit"
"github.com/mattermost/focalboard/server/utils"

mmModel "github.com/mattermost/mattermost-server/v6/model"
)

func (a *API) registerUsersRoutes(r *mux.Router) {
Expand Down Expand Up @@ -91,7 +93,7 @@ func (a *API) handleGetUsersList(w http.ResponseWriter, r *http.Request) {

ctx := r.Context()
session := ctx.Value(sessionContextKey).(*model.Session)
isSystemAdmin := a.permissions.HasPermissionTo(session.UserID, model.PermissionManageSystem)
isSystemAdmin := a.permissions.HasPermissionTo(session.UserID, mmModel.PermissionManageSystem)

for _, user := range users {
if user.ID == session.UserID {
Expand Down Expand Up @@ -270,7 +272,7 @@ func (a *API) handleGetUser(w http.ResponseWriter, r *http.Request) {
if userID == session.UserID {
user.Sanitize(map[string]bool{})
} else {
a.app.SanitizeProfile(user, a.permissions.HasPermissionTo(session.UserID, model.PermissionManageSystem))
a.app.SanitizeProfile(user, a.permissions.HasPermissionTo(session.UserID, mmModel.PermissionManageSystem))
}

userData, err := json.Marshal(user)
Expand Down

0 comments on commit 85825cb

Please sign in to comment.