public void CreateEditorPick(String sitename, String commentId) { ISite site = GetSite(sitename); if (site == null) { throw ApiException.GetError(ErrorType.UnknownSite); } try { _commentObj.CallingUser = GetCallingUser(site); if (_commentObj.CallingUser.IsUserA(UserTypes.Editor)) { var editorPicks = new EditorPicks(dnaDiagnostic, readerCreator, cacheManager, siteList); editorPicks.CreateEditorPick(Convert.ToInt32(commentId)); } else { throw new DnaWebProtocolException(ApiException.GetError(ErrorType.MissingEditorCredentials)); } } catch (ApiException ex) { throw new DnaWebProtocolException(ex); } }
public void RemoveEditorPick(string commentId, string siteName) { ISite site = GetSite(siteName); try { _ratingObj.CallingUser = GetCallingUser(site); if (_ratingObj.CallingUser.IsUserA(UserTypes.Editor)) { EditorPicks editorPicks = new EditorPicks(dnaDiagnostic, readerCreator, cacheManager, siteList); editorPicks.RemoveEditorPick(Convert.ToInt32(commentId)); } else { throw new DnaWebProtocolException(ApiException.GetError(ErrorType.MissingEditorCredentials)); } } catch (ApiException ex) { throw new DnaWebProtocolException(ex); } }