Add update permissions hook to sharing

Hook for #3835 

@butonic