mirror of
https://github.com/mattermost/focalboard.git
synced 2025-01-08 15:06:08 +02:00
remove read token check from unnecessary functions (#2682)
This commit is contained in:
parent
3f6affbd83
commit
283d7669f3
@ -2832,8 +2832,7 @@ func (a *API) handleDuplicateBoard(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
hasValidReadToken := a.hasValidReadTokenForBoard(r, boardID)
|
if userID == "" {
|
||||||
if userID == "" && !hasValidReadToken {
|
|
||||||
a.errorResponse(w, r.URL.Path, http.StatusUnauthorized, "", PermissionError{"access denied to board"})
|
a.errorResponse(w, r.URL.Path, http.StatusUnauthorized, "", PermissionError{"access denied to board"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -2848,7 +2847,6 @@ func (a *API) handleDuplicateBoard(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !hasValidReadToken {
|
|
||||||
if board.Type == model.BoardTypePrivate {
|
if board.Type == model.BoardTypePrivate {
|
||||||
if !a.permissions.HasPermissionToBoard(userID, boardID, model.PermissionViewBoard) {
|
if !a.permissions.HasPermissionToBoard(userID, boardID, model.PermissionViewBoard) {
|
||||||
a.errorResponse(w, r.URL.Path, http.StatusForbidden, "", PermissionError{"access denied to board"})
|
a.errorResponse(w, r.URL.Path, http.StatusForbidden, "", PermissionError{"access denied to board"})
|
||||||
@ -2860,7 +2858,6 @@ func (a *API) handleDuplicateBoard(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
auditRec := a.makeAuditRecord(r, "duplicateBoard", audit.Fail)
|
auditRec := a.makeAuditRecord(r, "duplicateBoard", audit.Fail)
|
||||||
defer a.audit.LogRecord(audit.LevelRead, auditRec)
|
defer a.audit.LogRecord(audit.LevelRead, auditRec)
|
||||||
@ -2927,8 +2924,7 @@ func (a *API) handleDuplicateBlock(w http.ResponseWriter, r *http.Request) {
|
|||||||
query := r.URL.Query()
|
query := r.URL.Query()
|
||||||
asTemplate := query.Get("asTemplate")
|
asTemplate := query.Get("asTemplate")
|
||||||
|
|
||||||
hasValidReadToken := a.hasValidReadTokenForBoard(r, boardID)
|
if userID == "" {
|
||||||
if userID == "" && !hasValidReadToken {
|
|
||||||
a.errorResponse(w, r.URL.Path, http.StatusUnauthorized, "", PermissionError{"access denied to board"})
|
a.errorResponse(w, r.URL.Path, http.StatusUnauthorized, "", PermissionError{"access denied to board"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user