get permissions directly from share storage to avoid additional db calls

@icewind1991 please have a look at it, especially to my changes to OC\Files\Cache\Permissions

cc @PVince81