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:
@@ -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>
|
||||
)}
|
||||
|
Reference in New Issue
Block a user