mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
@@ -22,7 +22,7 @@ namespace Orchard.Specs.Bindings {
|
|||||||
webApp.Host.Execute(() => {
|
webApp.Host.Execute(() => {
|
||||||
using ( var environment = MvcApplication.CreateStandaloneEnvironment("Default") ) {
|
using ( var environment = MvcApplication.CreateStandaloneEnvironment("Default") ) {
|
||||||
var memberShipService = environment.Resolve<IMembershipService>();
|
var memberShipService = environment.Resolve<IMembershipService>();
|
||||||
var athorizationService = environment.Resolve<IAuthorizationService>();
|
var authorizationService = environment.Resolve<IAuthorizationService>();
|
||||||
var contentManager = environment.Resolve<IContentManager>();
|
var contentManager = environment.Resolve<IContentManager>();
|
||||||
|
|
||||||
var contentItem = contentManager.Create(contentType);
|
var contentItem = contentManager.Create(contentType);
|
||||||
@@ -30,7 +30,7 @@ namespace Orchard.Specs.Bindings {
|
|||||||
var otherUser = memberShipService.GetUser(otherName);
|
var otherUser = memberShipService.GetUser(otherName);
|
||||||
contentItem.As<ICommonPart>().Owner = otherUser;
|
contentItem.As<ICommonPart>().Owner = otherUser;
|
||||||
|
|
||||||
Assert.That(athorizationService.TryCheckAccess(GetPermissionForAction(action), user, contentItem), Is.True);
|
Assert.That(authorizationService.TryCheckAccess(GetPermissionForAction(action), user, contentItem), Is.True);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user