1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 23:20:51 +00:00

repo owner and admin can unlock file (#4791)

Co-authored-by: lian <lian@seafile.com>
This commit is contained in:
lian
2021-01-15 18:07:27 +08:00
committed by GitHub
parent 0853bade7c
commit c3c00e4abd
2 changed files with 13 additions and 13 deletions

View File

@@ -493,7 +493,7 @@ export const Utils = {
return list;
},
getFileOperationList: function(currentRepoInfo, dirent, isContextmenu) {
getFileOperationList: function(isRepoOwner, currentRepoInfo, dirent, isContextmenu) {
let list = [];
const { SHARE, DOWNLOAD, DELETE, RENAME, MOVE, COPY, TAGS, UNLOCK, LOCK,
COMMENT, HISTORY, ACCESS_LOG, OPEN_VIA_CLIENT } = TextTranslation;
@@ -525,7 +525,7 @@ export const Utils = {
if (isPro) {
if (dirent.is_locked) {
if (dirent.locked_by_me || dirent.lock_owner == 'OnlineOffice') {
if (dirent.locked_by_me || dirent.lock_owner == 'OnlineOffice' || isRepoOwner || currentRepoInfo.id_admin) {
list.push(UNLOCK);
}
} else {
@@ -560,7 +560,7 @@ export const Utils = {
getDirentOperationList: function(isRepoOwner, currentRepoInfo, dirent, isContextmenu) {
return dirent.type == 'dir' ?
Utils.getFolderOperationList(isRepoOwner, currentRepoInfo, dirent, isContextmenu) :
Utils.getFileOperationList(currentRepoInfo, dirent, isContextmenu);
Utils.getFileOperationList(isRepoOwner, currentRepoInfo, dirent, isContextmenu);
},
sharePerms: function(permission) {