diff options
author | Eduardo Morales <emoral435@gmail.com> | 2024-03-25 07:56:22 -0500 |
---|---|---|
committer | Eduardo Morales <emoral435@gmail.com> | 2024-03-26 10:10:45 -0500 |
commit | 7726b1556181a7475d2ba4b1a1e2584e88d82df0 (patch) | |
tree | 43f3ead596bd1f40d635f2006efab40a3d3b1424 /apps | |
parent | c376dbf97baf392720922b6e65e35a16ac2f56cb (diff) | |
download | nextcloud-server-7726b1556181a7475d2ba4b1a1e2584e88d82df0.tar.gz nextcloud-server-7726b1556181a7475d2ba4b1a1e2584e88d82df0.zip |
fix(personal-files): correctly filters groupfolders now
Signed-off-by: Eduardo Morales <emoral435@gmail.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/src/services/PersonalFiles.ts | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/apps/files/src/services/PersonalFiles.ts b/apps/files/src/services/PersonalFiles.ts index b451a509f63..cb65800898d 100644 --- a/apps/files/src/services/PersonalFiles.ts +++ b/apps/files/src/services/PersonalFiles.ts @@ -36,11 +36,14 @@ const currUserID = getCurrentUser()?.uid * @param {FileStat} node that contains * @return {Boolean} */ -export const personalFile = function(node: File): Boolean { - const isNotShared = currUserID ? node.owner === currUserID : true - && node.attributes['mount-type'] !== 'group' - && node.attributes['mount-type'] !== 'shared' - return isNotShared +export const isPersonalFile = function(node: File): Boolean { + // the type of mounts that determine whether the file is shared + const sharedMountTypes = ["group", "shared"] + const mountType = node.attributes['mount-type'] + // the check to determine whether the current logged in user is the owner / creator of the node + const currUserCreated = currUserID ? node.owner === currUserID : true + + return currUserCreated && !sharedMountTypes.includes(mountType) } export const getContents = (path: string = "/"): Promise<ContentsWithRoot> => { @@ -48,7 +51,7 @@ export const getContents = (path: string = "/"): Promise<ContentsWithRoot> => { // then filter the files that the user does not own, or has shared / is a group folder return getFiles(path) .then(c => { - c.contents = c.contents.filter(personalFile) as File[] + c.contents = c.contents.filter(isPersonalFile) as File[] return c }) }
\ No newline at end of file |