I am trying to display a list of files that user can see and download. I know there is the GetProtectedNodesForRole method that returns all root media nodes. The problem is that the GetProtectedNodesForRole method returns root nodes under which can be nodes protected by a different role, so I still need to check if the user is allowed to see nodes using the HasAccess method. Is it possible to get list of all nodes that are protected by the specified role.
Currently it's Rootnodes indeed. This is because checking for every childnode also could cause some performance issues. I will see if this can be improved in a future release.
What you can do is build the collection yourself by checking the children. and only display those who have access.
Get protected nodes
Hi,
I am trying to display a list of files that user can see and download. I know there is the GetProtectedNodesForRole method that returns all root media nodes. The problem is that the GetProtectedNodesForRole method returns root nodes under which can be nodes protected by a different role, so I still need to check if the user is allowed to see nodes using the HasAccess method. Is it possible to get list of all nodes that are protected by the specified role.
Thank you.
Hi Michal,
Currently it's Rootnodes indeed. This is because checking for every childnode also could cause some performance issues. I will see if this can be improved in a future release.
What you can do is build the collection yourself by checking the children. and only display those who have access.
Hope this helps for now.
Best,
Richard
Hi Richard,
Thank you very much for your quick response.
Michal
is working on a reply...