<?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: Set edit permission by attribute in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/set-edit-permission-by-attribute/m-p/792231#M2176</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found out about the Arcade global variable $originalFeature, which solves part of the second question:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// Allow changing the Version from Null to "Edit".&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// This also allows setting the default value of Version to "Edit".&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;IsEmpty&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$originalFeature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Version&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Version&lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Edit"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; True
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// Allow changes to the "Edit" version.&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$originalFeature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Version&lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Edit"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Version&lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Edit"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; True
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// Forbid everything else.&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; False‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;With this code, users can't edit old versions. I still have to disable the rule to change the edit version into an uneditable version, but that has to be done quite rarely, so that's fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That leaves only the first question: &lt;STRONG&gt;Is there a way to do something like this without using Attribute Rules?&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 09:06:11 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2021-12-12T09:06:11Z</dc:date>
    <item>
      <title>Set edit permission by attribute</title>
      <link>https://community.esri.com/t5/geodatabase-questions/set-edit-permission-by-attribute/m-p/792230#M2175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We want to incorporate flood protection lines (dykes and walls) into our geodatabase (sde).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our requirements:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;These lines are written into bylaws in semi regular intervals.&lt;/LI&gt;&lt;LI&gt;The different versions (e.g. bylaw 2015, bylaw 2017) have to be reproducible.&lt;/LI&gt;&lt;LI&gt;Only the newest version can be edited, old versions must not be editable.&lt;/LI&gt;&lt;LI&gt;One and only one feature class. We don't want a feature class for every version, we don't want to export old versions.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My idea:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Include a field describing the version, make it depending on a coded value domain.&lt;/LI&gt;&lt;LI&gt;Different versions can be reproduced with views or definition queries.&lt;/LI&gt;&lt;LI&gt;When the latest version is written into a bylaw, create a new coded value, copy all features from the last version and change the version field. We can do this manually or create a tool.&lt;/LI&gt;&lt;LI&gt;Somehow forbid users from editing old versions.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problems:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I could use an Attribute Rule to forbid editing old versions. But we haven't all switched to Pro yet, and AR make the feature class inaccessible in ArcMap. &lt;STRONG&gt;Is there another way to set edit permissions by attribute?&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;If I created a constraint AR with this code, triggered on insert, update, and delete:&lt;BR /&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;if($feature.Version=='Edit') {&lt;/P&gt;&lt;P&gt;&amp;nbsp; return True&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;return False&lt;/P&gt;&lt;/BLOCKQUOTE&gt;It works with responsible users, but an irresponsible user could still change the value of Version to 'Edit' and edit the feature. They can't change the value back to the original version, so it's the equivalent of deleting the feature from the version. Also, with this code I have to disable the rule to change all 'Edit' features to a new uneditable version.&lt;BR /&gt;&lt;STRONG&gt;Is there a way to circumvent these caveats?&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2020 14:08:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/set-edit-permission-by-attribute/m-p/792230#M2175</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2020-07-27T14:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Set edit permission by attribute</title>
      <link>https://community.esri.com/t5/geodatabase-questions/set-edit-permission-by-attribute/m-p/792231#M2176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found out about the Arcade global variable $originalFeature, which solves part of the second question:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// Allow changing the Version from Null to "Edit".&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// This also allows setting the default value of Version to "Edit".&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;IsEmpty&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$originalFeature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Version&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Version&lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Edit"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; True
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// Allow changes to the "Edit" version.&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$originalFeature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Version&lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Edit"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Version&lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Edit"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; True
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// Forbid everything else.&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; False‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;With this code, users can't edit old versions. I still have to disable the rule to change the edit version into an uneditable version, but that has to be done quite rarely, so that's fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That leaves only the first question: &lt;STRONG&gt;Is there a way to do something like this without using Attribute Rules?&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:06:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/set-edit-permission-by-attribute/m-p/792231#M2176</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-12-12T09:06:11Z</dc:date>
    </item>
  </channel>
</rss>

