Allow admins to edit parts

Needed for moderation
This commit is contained in:
Kurt Hutten
2021-06-25 19:43:14 +10:00
parent 87e43ab7ce
commit 29999bc2ce
2 changed files with 4 additions and 1 deletions

View File

@@ -27,7 +27,7 @@ const PartProfile = ({
const [isInvalid, setIsInvalid] = useState(false)
const { currentUser } = useAuth()
const editorRef = useRef(null)
const canEdit = currentUser?.sub === userPart.id
const canEdit = currentUser?.sub === userPart.id || currentUser?.roles.includes('admin')
const isImageEditable = !isEditable && canEdit // image is editable when not in profile edit mode in order to separate them as it's too hard too to upload an image to cloudinary temporarily until the use saves (and maybe have to clean up) for the time being
const part = userPart?.Part
const emotes = countEmotes(part?.Reaction)