<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Is it possible to prevent users from editing tasks in PRO in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/is-it-possible-to-prevent-users-from-editing-tasks/m-p/1361167#M76409</link>
    <description>&lt;P&gt;Correction there is a way to detect the current open task&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;// find the first project task item which is open&lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; taskItem = Project.Current.GetItems&amp;lt;TaskProjectItem&amp;gt;().FirstOrDefault(t =&amp;gt; t.IsOpen == &lt;SPAN&gt;true&lt;/SPAN&gt;);
&lt;SPAN&gt;// if there isn't a project task item, return&lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt; (taskItem == &lt;SPAN&gt;null&lt;/SPAN&gt;)
  &lt;SPAN&gt;return&lt;/SPAN&gt;;

&lt;STRONG&gt;if (taskItem.IsOpen)&lt;/STRONG&gt;
{
  &lt;SPAN&gt;// close it
  // NOTE : The task item will also be removed from the project
  //At 2.x -
  //TaskAssistantModule.CloseTaskAsync(taskItem.TaskItemGuid);&lt;/SPAN&gt;  TaskAssistantFactory.Instance.CloseTaskItemAsync(taskItem.TaskItemGuid);
}&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Dec 2023 21:31:56 GMT</pubDate>
    <dc:creator>Alaind_Espaignet</dc:creator>
    <dc:date>2023-12-14T21:31:56Z</dc:date>
    <item>
      <title>Is it possible to prevent users from editing tasks in PRO</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/is-it-possible-to-prevent-users-from-editing-tasks/m-p/1361161#M76408</link>
      <description>&lt;P&gt;As a GIS Developer, I build PRO tasks for GIS editors. I then package the tasks along with a PRO project.&lt;/P&gt;&lt;P&gt;Is there a way to prevent users from editing the tasks I created and potentially breaking them?&lt;/P&gt;&lt;P&gt;I could not find a checkbox like "Prevent users from editing Tasks" or better still from editing those "prescribed" tasks.&lt;/P&gt;&lt;P&gt;I see the SDK has the concept of command filters:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/CommandFilter" target="_blank"&gt;https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/CommandFilter&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Is that the only way I could possibly achieve this?&lt;/P&gt;&lt;P&gt;Assuming the "Edit in Task Designer" is a "command" I could filter it out right?&lt;/P&gt;&lt;P&gt;But then how would I know what specific task the user is trying to&amp;nbsp;&amp;nbsp;"Edit in Task Designer"&amp;nbsp; to forbid editing corporate/prescribed tasks yet allow them to create/edit their own.&lt;/P&gt;&lt;P&gt;I see the SDK has a Task assistant API allowing one to sniff out tasks in a project. But I see nothing along the lines of getting the current task in the task panel. Having this capability I could possibly use the task info to deduce its a prescribed task therefore filter out the "Edit in Task Designer" command or let it run.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Surely someone else has this crazy requirement that seemingly defeats the purpose of tasks.&lt;/P&gt;&lt;P&gt;But they have a point someone could mess with and break a task they don't fully understand.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Users can create/edit their own tasks but cannot muck with prescribed tasks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attribute rules have a lock down mechanism. It seems strange there isn't something similar for Tasks.&lt;/P&gt;&lt;P&gt;Ideally they would be able to see the task steps in read only mode.&lt;/P&gt;&lt;P&gt;Did I miss a hidden checkbox somewhere?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 21:20:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/is-it-possible-to-prevent-users-from-editing-tasks/m-p/1361161#M76408</guid>
      <dc:creator>Alaind_Espaignet</dc:creator>
      <dc:date>2023-12-14T21:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to prevent users from editing tasks in PRO</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/is-it-possible-to-prevent-users-from-editing-tasks/m-p/1361167#M76409</link>
      <description>&lt;P&gt;Correction there is a way to detect the current open task&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;// find the first project task item which is open&lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; taskItem = Project.Current.GetItems&amp;lt;TaskProjectItem&amp;gt;().FirstOrDefault(t =&amp;gt; t.IsOpen == &lt;SPAN&gt;true&lt;/SPAN&gt;);
&lt;SPAN&gt;// if there isn't a project task item, return&lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt; (taskItem == &lt;SPAN&gt;null&lt;/SPAN&gt;)
  &lt;SPAN&gt;return&lt;/SPAN&gt;;

&lt;STRONG&gt;if (taskItem.IsOpen)&lt;/STRONG&gt;
{
  &lt;SPAN&gt;// close it
  // NOTE : The task item will also be removed from the project
  //At 2.x -
  //TaskAssistantModule.CloseTaskAsync(taskItem.TaskItemGuid);&lt;/SPAN&gt;  TaskAssistantFactory.Instance.CloseTaskItemAsync(taskItem.TaskItemGuid);
}&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 21:31:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/is-it-possible-to-prevent-users-from-editing-tasks/m-p/1361167#M76409</guid>
      <dc:creator>Alaind_Espaignet</dc:creator>
      <dc:date>2023-12-14T21:31:56Z</dc:date>
    </item>
  </channel>
</rss>

