Check which permissions are possible to re-share a file

fix for #5832 

By default we share a file with the CRUD + Share permissions. But before setting this permissions we have to check if this permissions are allowed to make it possible to also reshare files if the user doesn't have full CRUDS rights.