Updated to handle sharing rules