1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 02:42:47 +00:00

Dir view permission fixup (#7383)

* ['dir view' page] fixed permission for creating files when the library is empty

* ['dir view' page] fixed permission for rotating images in the image preview dialog
This commit is contained in:
llj
2025-01-17 17:35:28 +08:00
committed by GitHub
parent 41efd64872
commit 9760eca25c
4 changed files with 68 additions and 30 deletions

View File

@@ -749,10 +749,20 @@ class DirentListView extends React.Component {
};
render() {
const { direntList } = this.props;
const { direntList, currentRepoInfo, userPerm } = this.props;
const { encrypted: repoEncrypted } = currentRepoInfo;
const isDesktop = Utils.isDesktop();
const repoEncrypted = this.props.currentRepoInfo.encrypted;
let canModifyFile = false;
if (['rw', 'cloud-edit'].indexOf(userPerm) != -1) {
canModifyFile = true;
} else {
const { isCustomPermission, customPermission } = Utils.getUserPermission(userPerm);
if (isCustomPermission) {
const { modify } = customPermission.permission;
canModifyFile = modify;
}
}
return (
<div
@@ -856,7 +866,7 @@ class DirentListView extends React.Component {
moveToNextImage={this.moveToNextImage}
onDeleteImage={this.deleteImage}
onRotateImage={this.rotateImage}
enableRotate={!repoEncrypted}
enableRotate={canModifyFile}
/>
</ModalPortal>
)}