diff --git a/products/ASC.Files/Client/src/HOCs/withBadges.js b/products/ASC.Files/Client/src/HOCs/withBadges.js index badba784b3..2f1dc46719 100644 --- a/products/ASC.Files/Client/src/HOCs/withBadges.js +++ b/products/ASC.Files/Client/src/HOCs/withBadges.js @@ -22,9 +22,10 @@ export default function withBadges(WrappedComponent) { this.state = { showConvertDialog: false }; } onClickLock = () => { - const { item, lockFileAction } = this.props; - const { locked, id } = item; + const { item, lockFileAction, isAdmin } = this.props; + const { locked, id, access } = item; + if (!isAdmin || !access === 0) return; lockFileAction(id, !locked).catch((err) => toastr.error(err)); }; @@ -163,6 +164,7 @@ export default function withBadges(WrappedComponent) { isTrashFolder, canConvert, onFilesClick, // from withFileAction HOC + isAdmin, } = this.props; const { fileStatus, access } = item; @@ -176,6 +178,7 @@ export default function withBadges(WrappedComponent) { const badgesComponent = ( (props.withAccess ? "pointer" : "default")}; } .badges { display: flex; @@ -59,6 +59,7 @@ const FilesRowContent = ({ isTrashFolder, onFilesClick, badgesComponent, + isAdmin, }) => { const { contentLength, @@ -66,6 +67,7 @@ const FilesRowContent = ({ filesCount, foldersCount, providerKey, + access, } = item; const onMobileRowClick = () => { @@ -73,6 +75,8 @@ const FilesRowContent = ({ onFilesClick(); }; + const withAccess = isAdmin || access === 0; + return ( <>