public async Task <bool> CloneNode(string id)
        {
            return(await Task.Run(() =>
            {
                if (engine == null)
                {
                    return false;
                }

                Nodes.Node node = engine.GetNode(id);

                if (node == null)
                {
                    engine.LogEngineError($"Can`t clone node [{id}]. Does not exist.");
                    return false;
                }

                if (node.GetNodeOptions().ProtectedAccess)
                {
                    if (!User.HasClaim(x => x.Type == UserClaims.EditorProtectedAccess))
                    {
                        engine.LogEngineError(
                            $"Can`t clone node [{node.Category}/{node.Type}]. No permissions for protected access.");
                        return false;
                    }
                }

                engine.CloneNode(id);

                return true;
            }));
        }
Ejemplo n.º 2
0
        public ActionResult Tasks(string id)
        {
            if (engine == null)
            {
                return(View("Error", ERROR_MESSAGE));
            }

            UiTimerNode node = engine.GetNode(id) as UiTimerNode;

            if (node == null)
            {
                return(NotFound());
            }

            ViewBag.NodeId = node.Id;
            ViewBag.Name   = node.Settings["Name"].Value;

            List <UITimerTask> tasks = node.GetAllTasks();

            return(View(tasks));
        }