<?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>Assign different permissions to a subclass</title><link>https://www.aras.com/community/f/applications/3417/assign-different-permissions-to-a-subclass</link><description>Is it possible to assign a different permission set to a subclass itemtype instead of the one used by the base class?</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: Assign different permissions to a subclass</title><link>https://www.aras.com/community/thread/1006?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2017 21:36:54 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:ae83b2c0-fd63-4bd9-9081-f1e34e1fc7c7</guid><dc:creator>Former Member</dc:creator><description>Why it cannot be done using standard Aras UI?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assign different permissions to a subclass</title><link>https://www.aras.com/community/thread/914?ContentTypeID=1</link><pubDate>Thu, 12 Oct 2017 13:40:14 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:a1e560fe-3195-445d-add8-a69636820e11</guid><dc:creator>Former Member</dc:creator><description>This is perfect, thanks!&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Assign different permissions to a subclass</title><link>https://www.aras.com/community/thread/912?ContentTypeID=1</link><pubDate>Thu, 12 Oct 2017 10:46:54 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:da413a3e-577b-479a-a798-495b120d9ea1</guid><dc:creator>Jillian Jakubowicz</dc:creator><description>Hi,

You can set permissions on a subclass using OnBeforeAdd and OnBeforeUpdate server events on the desired item.
You should be able to use the same method for both events.

In the method, check to see if the item has been set to a certain subclass.
If so, set the permission.

Below is some example code to get you started:
&lt;pre&gt;&lt;code&gt;
Innovator inn = this.getInnovator();

Aras.Server.Security.Identity plmIdentity = Aras.Server.Security.Identity.GetByName(&amp;quot;Aras PLM&amp;quot;);
bool PermissionWasSet = Aras.Server.Security.Permissions.GrantIdentity(plmIdentity);
try 
{
    if (this.getProperty(&amp;quot;classification&amp;quot;, &amp;quot;&amp;quot;) == &amp;quot;Assembly&amp;quot;) {
        Item permission = this.newItem(&amp;quot;Permission&amp;quot;, &amp;quot;get&amp;quot;);
        permission.setProperty(&amp;quot;name&amp;quot;, &amp;quot;Assembly Part&amp;quot;);
        permission.setAttribute(&amp;quot;select&amp;quot;, &amp;quot;id&amp;quot;);
        permission = permission.apply();
        if (permission.isError()) {
            return inn.newError(&amp;quot;Could not obtain Assembly Part permission. &amp;quot; + permission.getErrorDetail());
        }
    
        if (this.getProperty(&amp;quot;permission_id&amp;quot;) != permission.getID()) {
            this.setProperty(&amp;quot;permission_id&amp;quot;, permission.getID());
        }
    }
}
finally 
{
    if (PermissionWasSet) Aras.Server.Security.Permissions.RevokeIdentity(plmIdentity);    
}

return this;
&lt;/code&gt;&lt;/pre&gt;
&amp;nbsp;

Hope this helps :)
Jillian&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>