public void Cannot_execute_ReportQueries_without_permissions() { // Arrange LogWithNewAdmin(Modules.PlayerManager, Permissions.Update); // Act Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetAdminActivityLog()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetAdminAuthenticationLog()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetMemberAuthenticationLog()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetPlayerRecords()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetPlayerRecordsForExport()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetPlayerBetHistoryRecords()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetPlayerBetHistoryRecordsForExport()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetDepositRecords()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetDepositRecordsForExport()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetBrandRecords()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetBrandRecordsForExport()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetLicenseeRecords()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetLicenseeRecordsForExport()); //Assert.Throws<InsufficientPermissionsException>(() => _reportQueries.GetLanguageRecords()); //Assert.Throws<InsufficientPermissionsException>(() => _reportQueries.GetLanguageRecordsForExport()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetVipLevelRecords()); Assert.Throws <InsufficientPermissionsException>(() => _reportQueries.GetVipLevelRecordsForExport()); }
public JsonResult PlayerData(SearchPackage searchPackage) { var allowViewEmail = _authQueries.VerifyPermission(UserId, Permissions.ViewEmail, Modules.PlayerReport); var allowViewMobile = _authQueries.VerifyPermission(UserId, Permissions.ViewMobile, Modules.PlayerReport); var dataBuilder = new SearchPackageDataBuilder <PlayerRecord>(searchPackage, _queries.GetPlayerRecords()); var data = dataBuilder .Map(r => r.PlayerId, r => new object[] { r.Licensee, r.Brand, r.Username, allowViewMobile ? r.Mobile : r.Mobile.MaskMobile(), allowViewEmail ? r.Email : r.Email.MaskEmail(), r.Birthday, r.IsInternalAccount, r.RegistrationDate, r.IsInactive, r.Language, r.Currency, r.SignUpIP, r.VipLevel, r.Country, r.PlayerName, r.Title, r.Gender, r.StreetAddress, r.PostCode, r.Created, r.CreatedBy, r.Updated, r.UpdatedBy, r.Activated, r.ActivatedBy, r.Deactivated, r.DeactivatedBy }) .GetPageData(r => r.RegistrationDate); return(new JsonResult { Data = data, MaxJsonLength = int.MaxValue, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }