Fix share permission detection (cherry picked from commit b9c9473) (cherry picked from commit cc8a216)
Fix share permission detection
(cherry picked from commit b9c9473)
(cherry picked from commit cc8a216)

efueger/galleryplus,leftees/galleryplus,leftees/galleryplus,patman15/galleryplus,patman15/galleryplus,leftees/galleryplus,patman15/galleryplus,efueger/galleryplus