public bool ChangePassword(string authenticationCookie, string userName, string oldPassword, string newPassword, string userData) { string authUserName; ServiceUtils.Authenticate(_addin, authenticationCookie, out authUserName, null); if (string.IsNullOrEmpty(userName) || (string.Compare(authUserName, userName, true) == 0)) { return(_addin.ChangePassword(authUserName, oldPassword, newPassword, userData)); } else { ServiceUtils.Authorize(_addin, authUserName, PermissionsTable.Instance.CanManageUsers, null); return(_addin.ChangePassword(userName, oldPassword, newPassword, userData)); } }