get permissions directly from share storage to avoid additional db calls
no need to empty array in a special way
check if it is a share storage
Merge pull request #8698 from owncloud/sharing_improve_permissions

get permissions directly from share storage to avoid additional db calls