private void CheckPermission(PermissionInfoCollection pc, PermissionInfo pinfo, object checkObject, out bool result, bool throwException = true)
 {
     result = true;
     if (!pc.Contains(pinfo))
     {
         result = false;
         if (throwException)
         {
             AccessException ae = new AccessException("there is no access for " + FactoryServices.PrincipalStorageFactory.GetStorage().GetCurrentToken().Name);
             ae.CheckObject = checkObject;
             throw ae;
         }
     }
 }