Get only my files from folder

cancel
Showing results for 
Search instead for 
Did you mean: 
MartinTichovsky
Member II

Get only my files from folder

Jump to solution

Hello,

how can i use API

GET /alfresco/api/-default-/public/alfresco/versions/1/nodes/{nodeId}/children

 to show only my files? 

An what if i don't have permission to show folder in sites/Test/documentLibrary/Documents, but someone moved there files where i am as Collaborator, how can i show files from this folder, without managing permissions on the folder?

Thanks

1 Solution

Accepted Solutions
afaust
Master

Re: Get only my files from folder

Jump to solution

These requirements are where you would switch from the regular "children" navigation / listing operation and use the "search" API instead. This would allow you to combine a condition for "my files", which in AFTS query expression would look like this: 

(=cm:creator:"myUserName" AND NOT PROPERTIES:"{http://www.alfresco.org/model/content/1.0}owner") OR =cm:owner:"myUserName"

..with the condition of "in folder X", which in AFTS query expression would be:

PARENT:"folderNodeRef"

If you wanted to find files in folders where you don't have access to the folder itself, but the files therein, then "search" is also about your only chance to find those.

View solution in original post

1 Reply
afaust
Master

Re: Get only my files from folder

Jump to solution

These requirements are where you would switch from the regular "children" navigation / listing operation and use the "search" API instead. This would allow you to combine a condition for "my files", which in AFTS query expression would look like this: 

(=cm:creator:"myUserName" AND NOT PROPERTIES:"{http://www.alfresco.org/model/content/1.0}owner") OR =cm:owner:"myUserName"

..with the condition of "in folder X", which in AFTS query expression would be:

PARENT:"folderNodeRef"

If you wanted to find files in folders where you don't have access to the folder itself, but the files therein, then "search" is also about your only chance to find those.