<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Permission Denied: needs Permission SYSTEM but the Session is SYSTEM</title><link>https://answers.axonivy.com/questions/1020/permission-denied-needs-permission-system-but-the-session-is-system</link><description>&lt;p&gt;I have a strange Exception here: &lt;/p&gt;
&lt;pre&gt;Session 0 (SYSTEM) is not allowed to call method public ch.ivyteam.ivy.workflow.IProcessData ch.ivyteam.ivy.workflow.internal.Task.getInternalProcessData().
The session does not fulfill the permission rule SESSION IS SYSTEM&lt;/pre&gt;

&lt;p&gt;This says the Session has the permission SYSTEM but the call was denied because the Session has not the permission SYSTEM.&lt;/p&gt;
&lt;p&gt;Code is:
&lt;/p&gt;&lt;pre&gt;final ITask task = Ivy.wfTask();
IProcessData ipd = Ivy.session().getSecurityContext()
    .executeAsSystemUser(new Callable&amp;lt;iprocessdata&amp;gt;() {&lt;p&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    @Override
    public IProcessData call() throws Exception {

        return task.getInternalProcessData();
    }

});
&lt;/code&gt;&lt;/pre&gt;
&lt;/pre&gt;</description><atom:link href="https://answers.axonivy.com/questions/1020/permission-denied-needs-permission-system-but-the-session-is-system" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 23 Oct 2014 20:19:40 -0400</lastBuildDate><item><title>Answer by Reto Weiss</title><link>https://answers.axonivy.com/questions/1020/permission-denied-needs-permission-system-but-the-session-is-system/1026</link><description>&lt;p&gt;&lt;code&gt;SESSION IS SYSTEM&lt;/code&gt; means the System itself. Note that there is also a user that is called SYSTEM. These are not the same. Seems that in your example you use the user SYSTEM and you are not running as SYSTEM. In the answer above you can choose between the methods executeAsSystem and executeAsSystemUser.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reto Weiss</dc:creator><pubDate>Thu, 23 Oct 2014 20:19:40 -0400</pubDate><guid>https://answers.axonivy.com/questions/1020/permission-denied-needs-permission-system-but-the-session-is-system/1026</guid></item><item><title>Comment by HaraldWeber on Reguel Wermelinger's answer</title><link>https://answers.axonivy.com/questions/1020/permission-denied-needs-permission-system-but-the-session-is-system#1025</link><description>&lt;p&gt;Yes this approach is working.
But the next call doesn't: task.writeInternalStartProcessData(processData);
(NullPointerException somewhere inside writeInternalStartProcessData)
Seems that I cant manually save the Task data..&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">HaraldWeber</dc:creator><pubDate>Thu, 23 Oct 2014 15:32:33 -0400</pubDate><guid>https://answers.axonivy.com/questions/1020/permission-denied-needs-permission-system-but-the-session-is-system#1025</guid></item><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/1020/permission-denied-needs-permission-system-but-the-session-is-system/1024</link><description>&lt;p&gt;Does it work if you use the SecurityManager approach to call the protected API?&lt;/p&gt;
&lt;p&gt;&lt;a href="http://answers.axonivy.com/questions/744/how-can-i-disable-xpert-ivy-security-permission-checks/746"&gt;http://answers.axonivy.com/questions/744/how-can-i-disable-xpert-ivy-security-permission-checks/746&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Thu, 23 Oct 2014 15:14:12 -0400</pubDate><guid>https://answers.axonivy.com/questions/1020/permission-denied-needs-permission-system-but-the-session-is-system/1024</guid></item></channel></rss>