Web: Removed the link if the user does not have rights.

This commit is contained in:
Tatiana Lopaeva 2022-11-07 14:03:18 +03:00
parent bb881b7510
commit be6530c8ff
2 changed files with 10 additions and 2 deletions

View File

@ -67,6 +67,7 @@ class DetailsHelper {
this.openUser = props.openUser;
this.personal = props.personal;
this.culture = props.culture;
this.isVisitor = props.isVisitor;
}
getPropertyList = () => {
@ -193,7 +194,7 @@ class DetailsHelper {
getItemOwner = () => {
const onOpenUser = () => this.openUser(this.item.createdBy, this.history);
return this.personal
return this.personal || this.isVisitor
? text(decodeString(this.item.createdBy?.displayName))
: link(decodeString(this.item.createdBy?.displayName), onOpenUser);
};
@ -245,7 +246,7 @@ class DetailsHelper {
getItemLastModifiedBy = () => {
const onOpenUser = () => this.openUser(this.item.updatedBy, this.history);
return this.personal
return this.personal || this.isVisitor
? text(decodeString(this.item.updatedBy?.displayName))
: link(decodeString(this.item.updatedBy?.displayName), onOpenUser);
};

View File

@ -18,6 +18,7 @@ const Details = ({
createThumbnail,
getInfoPanelItemIcon,
openUser,
isVisitor,
}) => {
const [itemProperties, setItemProperties] = useState([]);
@ -27,6 +28,7 @@ const Details = ({
const history = useHistory();
const detailsHelper = new DetailsHelper({
isVisitor,
t,
item: selection,
openUser,
@ -95,9 +97,13 @@ const Details = ({
};
export default inject(({ auth, filesStore }) => {
const { userStore } = auth;
const { selection, getInfoPanelItemIcon, openUser } = auth.infoPanelStore;
const { createThumbnail } = filesStore;
const { personal, culture } = auth.settingsStore;
const { user } = userStore;
const isVisitor = user.isVisitor;
return {
personal,
@ -106,5 +112,6 @@ export default inject(({ auth, filesStore }) => {
createThumbnail,
getInfoPanelItemIcon,
openUser,
isVisitor,
};
})(withTranslation(["InfoPanel", "Common", "Translations", "Files"])(Details));