Publish current project state
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gochat/gochat/internal/auth"
|
||||
"github.com/gochat/gochat/internal/model"
|
||||
"github.com/gochat/gochat/internal/repository"
|
||||
"github.com/gochat/gochat/internal/service"
|
||||
@@ -67,7 +68,7 @@ func (h *InboxHandler) List(c *gin.Context) {
|
||||
inboxes []model.Inbox
|
||||
svcErr error
|
||||
)
|
||||
if getRole(c) == "administrator" {
|
||||
if getRole(c) == auth.RoleAdministrator {
|
||||
inboxes, _, svcErr = h.svc.ListByAccount(c.Request.Context(), accountID, offset, perPage)
|
||||
} else {
|
||||
userID := getUserID(c)
|
||||
@@ -995,5 +996,5 @@ func (h *InboxHandler) ResetSecret(c *gin.Context) {
|
||||
}
|
||||
|
||||
func inboxSerializationAdmin(c *gin.Context) bool {
|
||||
return getRole(c) == "administrator"
|
||||
return getRole(c) == auth.RoleAdministrator
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user