<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.aras.com/community/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How can i create new permission and add that in</title><link>https://www.aras.com/community/f/development/37242/how-can-i-create-new-permission-and-add-that-in</link><description>Hello, 
 
 How can i add new permission and add on add 
 I am using the following mode, it is creating permission but not adding it</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: How can i create new permission and add that in</title><link>https://www.aras.com/community/thread/8162?ContentTypeID=1</link><pubDate>Fri, 25 Mar 2022 04:52:17 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:e8dd6864-f956-4ffb-9071-ea94e4cce2fe</guid><dc:creator>Gopikrishnan</dc:creator><description>&lt;p&gt;&lt;strong&gt;Hi hkhan&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For life cycle method, use below method in Post Event of life cycle transition&lt;/p&gt;
&lt;p&gt;Innovator inn = this.getInnovator();&lt;br /&gt;string docid = this.getID();&lt;br /&gt;Item permissions = this.newItem(&amp;quot;Permission&amp;quot;, &amp;quot;add&amp;quot;);&lt;br /&gt;permissions.setProperty(&amp;quot;name&amp;quot;, docid);&lt;br /&gt;Item access = this.newItem(&amp;quot;Access&amp;quot;, &amp;quot;add&amp;quot;);&lt;br /&gt;access.setProperty(&amp;quot;can_get&amp;quot;,&amp;quot;1&amp;quot;);&lt;br /&gt;access.setProperty(&amp;quot;can_update&amp;quot;,&amp;quot;1&amp;quot;);&lt;br /&gt;access.setProperty(&amp;quot;can_discover&amp;quot;,&amp;quot;1&amp;quot;);&lt;br /&gt;access.setProperty(&amp;quot;can_change_access&amp;quot;,&amp;quot;1&amp;quot;);&lt;br /&gt;access.setProperty(&amp;quot;related_id&amp;quot;,&amp;quot;8FE5430B42014D94AE83246F299D9CC4&amp;quot;);&lt;br /&gt;permissions.addRelationship(access);&lt;br /&gt;permissions.setProperty(&amp;quot;name&amp;quot;, docid);&lt;br /&gt;permissions = permissions.apply();&lt;br /&gt;this.setAction(&amp;quot;edit&amp;quot;);&lt;br /&gt;this.setProperty(&amp;quot;permission_id&amp;quot;, permissions.getID());&lt;br /&gt;this.setAttribute(&amp;quot;version&amp;quot;, &amp;quot;0&amp;quot;);&lt;br /&gt;Item result = this.apply();&lt;br /&gt;return this;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank You&lt;/p&gt;
&lt;p&gt;Gopikrishnan R&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can i create new permission and add that in</title><link>https://www.aras.com/community/thread/8156?ContentTypeID=1</link><pubDate>Thu, 24 Mar 2022 17:54:31 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:f636c234-bc7c-4685-aa44-647108ad4c0b</guid><dc:creator>hkhan</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;span&gt;Gopikrishnan&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am trying to run this method on the lifecycle transition but this does create a permission but not the link to the document, any idea why?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can i create new permission and add that in</title><link>https://www.aras.com/community/thread/8151?ContentTypeID=1</link><pubDate>Wed, 23 Mar 2022 17:31:12 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:0c948df0-8ff8-4629-b35f-ecd79612f781</guid><dc:creator>hkhan</dc:creator><description>&lt;p&gt;Thank you this is very helpful&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can i create new permission and add that in</title><link>https://www.aras.com/community/thread/8149?ContentTypeID=1</link><pubDate>Wed, 23 Mar 2022 15:16:52 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:e28c1fe9-2e9b-4cff-9168-198ee8efa5c3</guid><dc:creator>Gopikrishnan</dc:creator><description>&lt;p&gt;Hi Haider&lt;/p&gt;
&lt;p&gt;I&amp;#39;m able to&amp;nbsp;create&amp;nbsp;permission and attach it to the item. Between which user account are you using ? I tried to use Super User and it is working but it will not work for the normal user as there is no access defined for the permission added. I added creator to the permission which is getting created and provided update access.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Use below method (onBeforeAdd)&lt;/p&gt;
&lt;p&gt;Innovator inn = this.getInnovator();&lt;br /&gt;string docid = this.getID();&lt;br /&gt;Item permissions = this.newItem(&amp;quot;Permission&amp;quot;, &amp;quot;add&amp;quot;);&lt;br /&gt;permissions.setProperty(&amp;quot;name&amp;quot;, docid);&lt;br /&gt;Item access = this.newItem(&amp;quot;Access&amp;quot;, &amp;quot;add&amp;quot;);&lt;br /&gt;access.setProperty(&amp;quot;can_get&amp;quot;,&amp;quot;1&amp;quot;);&lt;br /&gt;access.setProperty(&amp;quot;can_update&amp;quot;,&amp;quot;1&amp;quot;);&lt;br /&gt;access.setProperty(&amp;quot;can_discover&amp;quot;,&amp;quot;1&amp;quot;);&lt;br /&gt;access.setProperty(&amp;quot;can_change_access&amp;quot;,&amp;quot;1&amp;quot;);&lt;br /&gt;access.setProperty(&amp;quot;related_id&amp;quot;,&amp;quot;8FE5430B42014D94AE83246F299D9CC4&amp;quot;);&lt;br /&gt;permissions.addRelationship(access);&lt;br /&gt;permissions.setProperty(&amp;quot;name&amp;quot;, docid);&lt;br /&gt;permissions = permissions.apply();&lt;br /&gt;this.setProperty(&amp;quot;permission_id&amp;quot;, permissions.getID()); &lt;br /&gt;return this;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Gopikrishnan R&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can i create new permission and add that in</title><link>https://www.aras.com/community/thread/8148?ContentTypeID=1</link><pubDate>Wed, 23 Mar 2022 14:36:26 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:c6004b15-15c0-4743-9a7e-33b35bda1c06</guid><dc:creator>haider</dc:creator><description>&lt;p&gt;Onafteradd or onbeforeadd server events&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can i create new permission and add that in</title><link>https://www.aras.com/community/thread/8147?ContentTypeID=1</link><pubDate>Wed, 23 Mar 2022 08:19:36 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:0c532071-991e-4c45-aa1b-6cf2d89bcb87</guid><dc:creator>AngelaIp</dc:creator><description>&lt;p&gt;What do you want to add where??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>