cancel
Showing results for 
Search instead for 
Did you mean: 

Get only my files from folder

MartinTichovsky
Champ in-the-making
Champ in-the-making

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 ACCEPTED ANSWER

afaust
Legendary Innovator
Legendary Innovator

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 answer in original post

1 REPLY 1

afaust
Legendary Innovator
Legendary Innovator

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.