Gets a few tests fixed
This commit is contained in:
@@ -111,7 +111,7 @@ namespace Umbraco.Core.Services
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Assigns a single permission to the current content item for the specified user ids
|
||||
/// Assigns a single permission to the current content item for the specified group ids
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <param name="permission"></param>
|
||||
|
||||
@@ -31,13 +31,11 @@ namespace Umbraco.Tests.Cache
|
||||
|
||||
new EventDefinition<ISectionService, EventArgs>(null, ServiceContext.SectionService, new EventArgs(), "Deleted"),
|
||||
new EventDefinition<ISectionService, EventArgs>(null, ServiceContext.SectionService, new EventArgs(), "New"),
|
||||
|
||||
new EventDefinition<IUserService, SaveEventArgs<IUserGroup>>(null, ServiceContext.UserService, new SaveEventArgs<IUserGroup>(Enumerable.Empty<IUserGroup>())),
|
||||
new EventDefinition<IUserService, DeleteEventArgs<IUserGroup>>(null, ServiceContext.UserService, new DeleteEventArgs<IUserGroup>(Enumerable.Empty<IUserGroup>())),
|
||||
|
||||
|
||||
new EventDefinition<IUserService, SaveEventArgs<IUser>>(null, ServiceContext.UserService, new SaveEventArgs<IUser>(Enumerable.Empty<IUser>())),
|
||||
new EventDefinition<IUserService, DeleteEventArgs<IUser>>(null, ServiceContext.UserService, new DeleteEventArgs<IUser>(Enumerable.Empty<IUser>())),
|
||||
new EventDefinition<IUserService, DeleteEventArgs<IUser>>(null, ServiceContext.UserService, new DeleteEventArgs<IUser>(Enumerable.Empty<IUser>())),
|
||||
new EventDefinition<IUserService, SaveEventArgs<IUserGroup>>(null, ServiceContext.UserService, new SaveEventArgs<IUserGroup>(Enumerable.Empty<IUserGroup>())),
|
||||
new EventDefinition<IUserService, DeleteEventArgs<IUserGroup>>(null, ServiceContext.UserService, new DeleteEventArgs<IUserGroup>(Enumerable.Empty<IUserGroup>())),
|
||||
|
||||
new EventDefinition<ILocalizationService, SaveEventArgs<IDictionaryItem>>(null, ServiceContext.LocalizationService, new SaveEventArgs<IDictionaryItem>(Enumerable.Empty<IDictionaryItem>())),
|
||||
new EventDefinition<ILocalizationService, DeleteEventArgs<IDictionaryItem>>(null, ServiceContext.LocalizationService, new DeleteEventArgs<IDictionaryItem>(Enumerable.Empty<IDictionaryItem>())),
|
||||
|
||||
@@ -1403,9 +1403,11 @@ namespace Umbraco.Tests.Services
|
||||
}));
|
||||
Assert.IsTrue(ServiceContext.PublicAccessService.AddRule(content1, "test2", "test2").Success);
|
||||
|
||||
Assert.IsNotNull(ServiceContext.NotificationService.CreateNotification(ServiceContext.UserService.GetUserById(0), content1, "test"));
|
||||
var user = ServiceContext.UserService.GetUserById(0);
|
||||
var userGroup = ServiceContext.UserService.GetUserGroupByAlias(user.Groups.First());
|
||||
Assert.IsNotNull(ServiceContext.NotificationService.CreateNotification(user, content1, "test"));
|
||||
|
||||
ServiceContext.ContentService.AssignContentPermission(content1, 'A', new[] {0});
|
||||
ServiceContext.ContentService.AssignContentPermission(content1, 'A', new[] { userGroup.Id});
|
||||
|
||||
Assert.IsTrue(ServiceContext.DomainService.Save(new UmbracoDomain("www.test.com", "en-AU")
|
||||
{
|
||||
|
||||
@@ -60,10 +60,10 @@ namespace Umbraco.Web.Cache
|
||||
() => SectionService.New -= SectionService_New);
|
||||
|
||||
// bind to user and user type events
|
||||
Bind(() => UserService.SavedUserGroup += UserServiceSavedUserGroup,
|
||||
() => UserService.SavedUserGroup -= UserServiceSavedUserGroup);
|
||||
Bind(() => UserService.DeletedUserGroup += UserServiceDeletedUserGroup,
|
||||
() => UserService.DeletedUserGroup -= UserServiceDeletedUserGroup);
|
||||
Bind(() => UserService.SavedUserGroup += UserService_SavedUserGroup,
|
||||
() => UserService.SavedUserGroup -= UserService_SavedUserGroup);
|
||||
Bind(() => UserService.DeletedUserGroup += UserService_DeletedUserGroup,
|
||||
() => UserService.DeletedUserGroup -= UserService_DeletedUserGroup);
|
||||
Bind(() => UserService.SavedUser += UserService_SavedUser,
|
||||
() => UserService.SavedUser -= UserService_SavedUser);
|
||||
Bind(() => UserService.DeletedUser += UserService_DeletedUser,
|
||||
@@ -630,12 +630,12 @@ namespace Umbraco.Web.Cache
|
||||
e.DeletedEntities.ForEach(x => DistributedCache.Instance.RemoveUserCache(x.Id));
|
||||
}
|
||||
|
||||
static void UserServiceSavedUserGroup(IUserService sender, SaveEventArgs<IUserGroup> e)
|
||||
static void UserService_SavedUserGroup(IUserService sender, SaveEventArgs<IUserGroup> e)
|
||||
{
|
||||
e.SavedEntities.ForEach(x => DistributedCache.Instance.RefreshUserGroupCache(x.Id));
|
||||
}
|
||||
|
||||
static void UserServiceDeletedUserGroup(IUserService sender, DeleteEventArgs<IUserGroup> e)
|
||||
static void UserService_DeletedUserGroup(IUserService sender, DeleteEventArgs<IUserGroup> e)
|
||||
{
|
||||
e.DeletedEntities.ForEach(x => DistributedCache.Instance.RemoveUserGroupCache(x.Id));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user