From e1d8af4498b103c8f991a388a56e9bf1477cafa1 Mon Sep 17 00:00:00 2001 From: Awais Ansari <79941147+awais-ansari@users.noreply.github.com> Date: Tue, 17 Jan 2023 17:41:32 +0500 Subject: [PATCH] fix: editedBy and closedBy banner will be visible to global staff (#410) * fix: editedBy and closedBy banner will be visible to global staff * refactor: rename isAdmin to userIsGlobalStaff --- src/discussions/common/AlertBanner.jsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/discussions/common/AlertBanner.jsx b/src/discussions/common/AlertBanner.jsx index ca30a023..4b18c271 100644 --- a/src/discussions/common/AlertBanner.jsx +++ b/src/discussions/common/AlertBanner.jsx @@ -10,7 +10,9 @@ import { Report } from '@edx/paragon/icons'; import { commentShape } from '../comments/comment/proptypes'; import messages from '../comments/messages'; -import { selectModerationSettings, selectUserHasModerationPrivileges, selectUserIsGroupTa } from '../data/selectors'; +import { + selectModerationSettings, selectUserHasModerationPrivileges, selectUserIsGroupTa, selectUserIsStaff, +} from '../data/selectors'; import { postShape } from '../posts/post/proptypes'; import AuthorLabel from './AuthorLabel'; @@ -20,10 +22,13 @@ function AlertBanner({ }) { const userHasModerationPrivileges = useSelector(selectUserHasModerationPrivileges); const userIsGroupTa = useSelector(selectUserIsGroupTa); + const userIsGlobalStaff = useSelector(selectUserIsStaff); const { reasonCodesEnabled } = useSelector(selectModerationSettings); const userIsContentAuthor = getAuthenticatedUser().username === content.author; - const canSeeLastEditOrClosedAlert = (userHasModerationPrivileges || userIsContentAuthor || userIsGroupTa); const canSeeReportedBanner = content?.abuseFlagged; + const canSeeLastEditOrClosedAlert = (userHasModerationPrivileges || userIsGroupTa + || userIsGlobalStaff || userIsContentAuthor + ); return ( <>