CORE-5353 Fixed error reporting in /secured/(un)share endpoint.
CORE-5353 Fixed desired perm check in shared? function.

Fixed logic by checking desired permission keyword against a current permission keyword, rather than checking against a permission map.