Cache: provide a function to get the permissions of all files in a folder with one query

Conflicts:
	lib/files/view.php
Only retrieve the current user's permissions
Implement getDirectoryPermissions() in Shared Permissions, fixes #2846
Merge pull request #3965 from dphi/fix_2846

speedup for propfinds on shared folders