Web: Added additional conditions added.
This commit is contained in:
parent
c3ffe890ab
commit
7922b78a57
@ -149,30 +149,6 @@ class AccessRightsStore {
|
||||
|
||||
return getFileRoleActions(access).canCopy;
|
||||
};
|
||||
generalDeleteProhibitionConditions = (rootFolderType, fileEditing) =>
|
||||
rootFolderType === FolderType.Archive ||
|
||||
rootFolderType === FolderType.TRASH ||
|
||||
rootFolderType === FolderType.Favorites ||
|
||||
rootFolderType === FolderType.Recent ||
|
||||
rootFolderType === FolderType.Privacy ||
|
||||
fileEditing;
|
||||
canDeleteItsItems = (item) => {
|
||||
const { rootFolderType, access, editing: fileEditing } = item;
|
||||
|
||||
if (this.generalDeleteProhibitionConditions(rootFolderType, fileEditing))
|
||||
return false;
|
||||
|
||||
return getFileRoleActions(access).deleteSelf;
|
||||
};
|
||||
|
||||
canDeleteAlienItems = (item) => {
|
||||
const { rootFolderType, access, editing: fileEditing } = item;
|
||||
|
||||
if (this.generalDeleteProhibitionConditions(rootFolderType, fileEditing))
|
||||
return false;
|
||||
|
||||
return getFileRoleActions(access).deleteAlien;
|
||||
};
|
||||
|
||||
canMakeForm = (item) => {
|
||||
const { rootFolderType, access } = item;
|
||||
@ -247,12 +223,20 @@ class AccessRightsStore {
|
||||
return moveSelf || moveAlien;
|
||||
};
|
||||
|
||||
canDeleteFile = (room) => {
|
||||
const { rootFolderType } = room;
|
||||
canDeleteItems = (item) => {
|
||||
const { rootFolderType, access, editing: fileEditing } = item;
|
||||
|
||||
if (rootFolderType === FolderType.Archive) return false;
|
||||
if (
|
||||
rootFolderType === FolderType.Archive ||
|
||||
rootFolderType === FolderType.TRASH ||
|
||||
rootFolderType === FolderType.Favorites ||
|
||||
rootFolderType === FolderType.Recent ||
|
||||
rootFolderType === FolderType.Privacy ||
|
||||
fileEditing
|
||||
)
|
||||
return false;
|
||||
|
||||
const { deleteSelf, deleteAlien } = getFileRoleActions(room.access);
|
||||
const { deleteSelf, deleteAlien } = getFileRoleActions(access);
|
||||
|
||||
return deleteSelf || deleteAlien;
|
||||
};
|
||||
|
@ -1269,7 +1269,7 @@ class FilesActionStore {
|
||||
|
||||
const {
|
||||
canCopyItems,
|
||||
canDeleteFile,
|
||||
canDeleteItems,
|
||||
canMoveItems,
|
||||
canArchiveRoom,
|
||||
canRemoveRoom,
|
||||
@ -1314,7 +1314,7 @@ class FilesActionStore {
|
||||
return canRemove.length > 0;
|
||||
|
||||
case "delete":
|
||||
const canDelete = canDeleteFile({ access, rootFolderType });
|
||||
const canDelete = canDeleteItems({ access, rootFolderType });
|
||||
const deleteCondition =
|
||||
!isThirdPartyRootSelection &&
|
||||
hasSelection &&
|
||||
|
Loading…
Reference in New Issue
Block a user