Esempio n. 1
0
 public void RemoveAccessMember(ITableCategory category, TaskContext context)
 {
     category.Dispatcher.Invoke(() =>
     {
         if (category.Parent == null)
         {
             return;
         }
         var userContext = category.GetService(typeof(IUserContext)) as IUserContext;
         var memberID    = userContext.Dispatcher.Invoke(() => userContext.Select(item => item.Path).Random());
         if (NameValidator.VerifyItemPath(memberID) == true)
         {
             category.RemoveAccessMember(context.Authentication, new ItemName(memberID).Name);
         }
         else
         {
             category.RemoveAccessMember(context.Authentication, memberID);
         }
     });
 }
 public static void RemoveAccessMemberFailTest <T>(ICremaHost cremaHost, ITableCategory category, Authentication authentication, string memberID) where T : Exception
 {
     cremaHost.Dispatcher.Invoke(() =>
     {
         try
         {
             category.RemoveAccessMember(authentication, memberID);
             Assert.Fail("RemoveAccessMember");
         }
         catch (T)
         {
         }
     });
 }
Esempio n. 3
0
 public static void RemoveAccessMemberFailTest <T>(ITableCategory category, Authentication authentication, string memberID) where T : Exception
 {
     Assert.AreNotEqual(null, category.Parent);
     category.Dispatcher.Invoke(() =>
     {
         try
         {
             category.RemoveAccessMember(authentication, memberID);
             Assert.Fail("RemoveAccessMemberFailTest");
         }
         catch (T)
         {
         }
     });
 }
 public void RemoveAccessMember()
 {
     category.RemoveAccessMember(authentication, "admin");
 }