cancel
Showing results for 
Search instead for 
Did you mean: 

Fastest way to retrieve all content for a user?

albertomv
Champ in-the-making
Champ in-the-making
Hello!

I'm trying to develop a WebScript to retrieve all content from the repository (from app:company_home//*) where an user has access (i.e. Consumer permission) and doing it the fastest way possible.

I've tried several approachs, the fastest being:

Set<NodeRef> nodes = permissionService
            .findNodesByAssignedPermissionForCurrentUser(
                  PermissionService.CONSUMER, true, true, true);

and then walking the tree recursively from these nodes checking permission access without repeating searchs (i.e. one of the nodes in the set containing another as descendant).

This approach is slightly faster than walking the whole app:company_home tree.

The problem is that its performance depends mostly in the "inherit permissions" property of a node and in the state of the permission cache.

I also tried with Lucene, but Lucene Search doesn't seem to support user-permission metadata, does it?

Any ideas or suggestions would highly appreciated!

Thanks!
1 REPLY 1

andy
Champ on-the-rise
Champ on-the-rise
Hi

There is no easy way to do what you want.

2.2 will have a new permission model which will make this query possible, althought the support you want is likely not to be implemented in the first cut. I will take another look.

Andy