Netcore: Package support for media + media types (#9547)

* Add support for media when installing a package

* clean up

* Fix tests

* Add support for media when installing a package

* clean up

* Fix tests

* moved tests + test data

* Migrated package tests + resources

* Fix issue with media picker on package page, was empty after save.

* Added missing files

* Fix casing issue of resources

* Added test for media

* Fix tests for linux

* Fix test

* Fix issue with move media..

* Fix issue with adding files to packages

* Add MediaType permissions.

* Fix test

* Fix test

* Retry flaky tests, and added TODOs to fix those

* new attempt to fix test

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
This commit is contained in:
Bjarke Berg
2020-12-16 22:26:47 +01:00
committed by GitHub
parent 5119e8da9c
commit 0151c435f1
55 changed files with 1130 additions and 953 deletions

View File

@@ -479,7 +479,7 @@ namespace Umbraco.Web.BackOffice.Controllers
{
// Authorize...
var requirement = new MediaPermissionsResourceRequirement();
var authorizationResult = await _authorizationService.AuthorizeAsync(User, _mediaService.GetById(move.Id), requirement);
var authorizationResult = await _authorizationService.AuthorizeAsync(User, new MediaPermissionsResource(_mediaService.GetById(move.Id)), requirement);
if (!authorizationResult.Succeeded)
{
return Forbid();