Skip to content

Commit

Permalink
Making the get of images and uploading of custom images temporary all…
Browse files Browse the repository at this point in the history
…owed for Anonymous
  • Loading branch information
renemadsen committed Feb 4, 2019
1 parent 1440aca commit dbbbf8c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ public async Task<IActionResult> Csv(int id)
return File(fileStream, "application/octet-stream", fileName);
}

[HttpGet]
[HttpGet]
[AllowAnonymous]
[Route("api/template-files/get-image/{fileName}.{ext}")]
[Authorize(AuthenticationSchemes = CookieAuthenticationDefaults.AuthenticationScheme,
Policy = AuthConsts.EformPolicies.Cases.CasesRead)]
// [Authorize(AuthenticationSchemes = CookieAuthenticationDefaults.AuthenticationScheme,
// Policy = AuthConsts.EformPolicies.Cases.CasesRead)]
public IActionResult GetImage(string fileName, string ext, string noCache = "noCache")
{
var core = _coreHelper.GetCore();
Expand Down
10 changes: 6 additions & 4 deletions eFormAPI/eFormAPI.Web/Controllers/ImagesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ public IActionResult GetLoginPageImage(string fileName)
return File(fileStream, $"image/{extention}");
}

[HttpPost]
[Authorize(Roles = EformRole.Admin, AuthenticationSchemes = CookieAuthenticationDefaults.AuthenticationScheme)]
[HttpPost]
[AllowAnonymous]
// [Authorize(Roles = EformRole.Admin, AuthenticationSchemes = CookieAuthenticationDefaults.AuthenticationScheme)]
[Route("api/images/login-page-images")]
public async Task<IActionResult> PostLoginPageImages(IFormFile file)
{
Expand Down Expand Up @@ -97,8 +98,9 @@ public async Task<IActionResult> PostLoginPageImages(IFormFile file)
return BadRequest(_localizationService.GetString("InvalidRequest"));
}

[HttpPost]
[Authorize(Roles = EformRole.Admin, AuthenticationSchemes = CookieAuthenticationDefaults.AuthenticationScheme)]
[HttpPost]
[AllowAnonymous]
// [Authorize(Roles = EformRole.Admin, AuthenticationSchemes = CookieAuthenticationDefaults.AuthenticationScheme)]
[Route("api/images/eform-images")]
public async Task<IActionResult> PostEformImages(IFormFile file)
{
Expand Down

0 comments on commit dbbbf8c

Please sign in to comment.