public static async Task<IList<string>> CheckRegistrationAuthorizationForEdit(IRegistrationOwnership registrationOwnership, PackageIdentity packageIdentity)
        {
            IList<string> errors = new List<string>();

            if (!await registrationOwnership.HasNamespace(packageIdentity.Namespace))
            {
                errors.Add("user is not allowed to publish in this namespace");
                return errors;
            }

            if (await registrationOwnership.HasRegistration(packageIdentity.Namespace, packageIdentity.Id))
            {
                if (!await registrationOwnership.HasOwner(packageIdentity.Namespace, packageIdentity.Id))
                {
                    errors.Add("user does not have access to this registration");
                    return errors;
                }
            }
            else
            {
                errors.Add("this package does not exist in the ownership record");
            }

            return errors;
        }
        public static async Task<IList<string>> CheckRegistrationAuthorization(IRegistrationOwnership registrationOwnership, PackageIdentity packageIdentity)
        {
            IList<string> errors = new List<string>();

            if (!await registrationOwnership.HasNamespace(packageIdentity.Namespace))
            {
                errors.Add("user is not allowed to publish in this namespace");
                return errors;
            }

            if (await registrationOwnership.HasRegistration(packageIdentity.Namespace, packageIdentity.Id))
            {
                if (!await registrationOwnership.HasOwner(packageIdentity.Namespace, packageIdentity.Id))
                {
                    errors.Add("user does not have access to this registration");
                    return errors;
                }

                if (await registrationOwnership.HasVersion(packageIdentity.Namespace, packageIdentity.Id, packageIdentity.Version.ToString()))
                {
                    errors.Add("this package version already exists for this registration");
                    return errors;
                }
            }

            return errors;
        }