<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Active ivy role</title><link>https://answers.axonivy.com/questions/2745/active-ivy-role</link><description>&lt;p&gt;Hi every body, I used ivy API createChildRole(...) to create a new child role of an existed role, but I checked and known that the new role is not active (by calling method SecurityContext.getActiveRoles() to return a list of active roles, but the new role was not included in that list). Anyone know how to active that role by ivy API?
Thank you&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/2745/active-ivy-role" rel="self"></atom:link><language>en</language><lastBuildDate>Wed, 12 Jul 2017 06:48:16 -0400</lastBuildDate><item><title>Comment by nguyenbkcse on Flavio Sadeghi's answer</title><link>https://answers.axonivy.com/questions/2745/active-ivy-role#2750</link><description>&lt;p&gt;Dear &lt;a href="http://answers.axonivy.com/users/21/flavio-sadeghi"&gt;&lt;a href="http://answers.axonivy.com/users/21/flavio-sadeghi"&gt;@Flavio Sadeghi&lt;/a&gt;&lt;/a&gt;, I got your idea, thank you&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nguyenbkcse</dc:creator><pubDate>Wed, 12 Jul 2017 06:48:16 -0400</pubDate><guid>https://answers.axonivy.com/questions/2745/active-ivy-role#2750</guid></item><item><title>Answer by Flavio Sadeghi</title><link>https://answers.axonivy.com/questions/2745/active-ivy-role/2748</link><description>&lt;p&gt;Dear &lt;a href="http://answers.axonivy.com/users/845/nguyenbkcse"&gt;&lt;a href="http://answers.axonivy.com/users/845/nguyenbkcse"&gt;@nguyenbkcse&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As &lt;a href="http://answers.axonivy.com/users/118/trungdv"&gt;&lt;a href="http://answers.axonivy.com/users/118/trungdv"&gt;@trungdv&lt;/a&gt;&lt;/a&gt; has pointed out:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The method SecurityContext.getRoles() returns all roles of the current running application. Whether the roles are still used or not.&lt;/li&gt;
&lt;li&gt;The method SecurityContext.getActiveRoles() returns all roles which are still defined in a active PMV (active = release state of the pmv is released or deprecated). Roles created by API will not be defined in a PMV (in a Project/roles.roleconfig file). Therefore they are not listed as active roles. The naming 'active' may lead to confusion. Basically the idea was to filter roles, which are no longer defined in project, since they are no longer used in a current running process and only exists to tracking workflow history...&lt;/li&gt;
&lt;/ul&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Flavio Sadeghi</dc:creator><pubDate>Wed, 12 Jul 2017 05:51:42 -0400</pubDate><guid>https://answers.axonivy.com/questions/2745/active-ivy-role/2748</guid></item><item><title>Comment by nguyenbkcse on nguyenbkcse's question</title><link>https://answers.axonivy.com/questions/2745/active-ivy-role#2747</link><description>&lt;p&gt;Dear &lt;a href="http://answers.axonivy.com/users/118/trungdv"&gt;&lt;a href="http://answers.axonivy.com/users/118/trungdv"&gt;@trungdv&lt;/a&gt;&lt;/a&gt;, I don't call this api, I used AdminUI, and to show the default role list (without checking the checkbox "Display obsolete Roles"), I saw the source code call getActiveRoles().
Of course, the new roles I created are not in that list so I can't see the role in default list (you can see only if you check the checkbox)
If you have AdminUI source code and investigate the code, you can see what I mentioned&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nguyenbkcse</dc:creator><pubDate>Mon, 10 Jul 2017 23:49:13 -0400</pubDate><guid>https://answers.axonivy.com/questions/2745/active-ivy-role#2747</guid></item><item><title>Comment by trungdv on nguyenbkcse's question</title><link>https://answers.axonivy.com/questions/2745/active-ivy-role#2746</link><description>&lt;p&gt;hi &lt;a href="http://answers.axonivy.com/users/845/nguyenbkcse"&gt;&lt;a href="http://answers.axonivy.com/users/845/nguyenbkcse"&gt;@nguyenbkcse&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Can i ask you reason why you need to call this api? why it's not SecurityContext().getRoles()/getAllRoles(). &lt;/p&gt;
&lt;p&gt;IMO, Active role somehow is handle by ivy system.
One mention about that api here: &lt;/p&gt;
&lt;pre&gt;&lt;code&gt; In comparison to ISecurityContext.getRoles() those roles will be excluded, which only exists in 
outdated Process Model Versions.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We should use it with care&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">trungdv</dc:creator><pubDate>Mon, 10 Jul 2017 23:30:18 -0400</pubDate><guid>https://answers.axonivy.com/questions/2745/active-ivy-role#2746</guid></item></channel></rss>