Skip to content

Commit

Permalink
Fix permission checker
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Mar 11, 2024
1 parent b3f66fa commit 60bbc16
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/spaces/roles/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ export const useCheckCanEditAndHideSpacePermission = ({ post: { struct }, space
}

const canHidePost =
(isMyPost && checkSpacePermission(hideOwn)) || checkSpacePermission('HideAnyPost')
(isMyPost && checkSpacePermission(hideOwn)) ||
(!isComment && checkSpacePermission('HideAnyPost'))

const canEditPost =
(isMyPost && checkSpacePermission(updateOwn)) || checkSpacePermission('UpdateAnyPost')
(isMyPost && checkSpacePermission(updateOwn)) ||
(!isComment && checkSpacePermission('UpdateAnyPost'))

const canMovePost = isMyPost && !isComment

Expand Down

0 comments on commit 60bbc16

Please sign in to comment.