public IActionResult Index() { #if RELEASE var user = _userService.GetUserBySystemName(User); if (!_permissionService.Authorize(StandardPermissionProvider.ManageMenu, user)) { return(AccessDeniedView()); } #endif var items = _externalLinkService.GetAll(); return(View(items)); }
public IHttpActionResult GetAll() { var externalLinks = _externalLinkService.GetAll(GetUserAndOrganization().OrganizationId); var externalLinksViewModel = _mapper.Map <IEnumerable <ExternalLinkDTO>, IEnumerable <ExternalLinkViewModel> >(externalLinks); return(Ok(externalLinksViewModel)); }
public void Should_Return_All_External_Link_Depending_On_Organization() { MockExternalLinks(); var result = _externalLinkService.GetAll(2).ToList(); Assert.AreEqual(2, result.Count()); Assert.AreEqual("Test1", result.First().Name); }
public JsonResult GetExternalLinks() { var model = _externalLinkService.GetAll().OrderByDescending(a => a.Order); return(new JsonResult(model)); }