Skip to content

Commit

Permalink
Fix useHasPermission minimumRole cascade check (mattermost-community#…
Browse files Browse the repository at this point in the history
…3949)

(cherry picked from commit 2f90840)
  • Loading branch information
mgdelacroix authored and mattermost-build committed Oct 6, 2022
1 parent 3c59c99 commit 802c4ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webapp/src/hooks/permissions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ export const useHasPermissions = (teamId: string, boardId: string, permissions:
if (editorPermissions.includes(permission) && (member.schemeAdmin || member.schemeEditor || board.minimumRole === MemberRole.Editor)) {
return true
}
if (commenterPermissions.includes(permission) && (member.schemeAdmin || member.schemeEditor || member.schemeCommenter || board.minimumRole === MemberRole.Commenter)) {
if (commenterPermissions.includes(permission) && (member.schemeAdmin || member.schemeEditor || member.schemeCommenter || board.minimumRole === MemberRole.Commenter || board.minimumRole === MemberRole.Editor)) {
return true
}
if (viewerPermissions.includes(permission) && (member.schemeAdmin || member.schemeEditor || member.schemeCommenter || member.schemeViewer || board.minimumRole === MemberRole.Viewer)) {
if (viewerPermissions.includes(permission) && (member.schemeAdmin || member.schemeEditor || member.schemeCommenter || member.schemeViewer || board.minimumRole === MemberRole.Viewer || board.minimumRole === MemberRole.Commenter || board.minimumRole === MemberRole.Editor)) {
return true
}
}
Expand Down

0 comments on commit 802c4ec

Please sign in to comment.