<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Salim Hlayel]]></title><description><![CDATA[Oracle APEX and other stuff!]]></description><link>https://salimhlayel.com</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 14:00:41 GMT</lastBuildDate><atom:link href="https://salimhlayel.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Granular Access for EBS-APEX Extension]]></title><description><![CDATA[In versions 5.1 and 5.2 of the “Extending Oracle E-Business Suite Release 12.2 Using Oracle APEX” technical paper, the EBS team has provided a streamlined patches to ease the integration between Oracle APEX and E-Business Suite.
The patches allow to ...]]></description><link>https://salimhlayel.com/granular-access-for-ebs-apex-extension</link><guid isPermaLink="true">https://salimhlayel.com/granular-access-for-ebs-apex-extension</guid><category><![CDATA[orclapex]]></category><category><![CDATA[ebs]]></category><dc:creator><![CDATA[Salim Hlayel]]></dc:creator><pubDate>Wed, 13 Aug 2025 11:57:17 GMT</pubDate><content:encoded><![CDATA[<p>In versions 5.1 and 5.2 of the “<a target="_blank" href="https://apex.oracle.com/go/ebs">Extending Oracle E-Business Suite Release 12.2 Using Oracle APEX</a>” technical paper, the EBS team has provided a streamlined patches to ease the integration between Oracle APEX and E-Business Suite.</p>
<p>The patches allow to have great functionalities that can be summarized as follows:</p>
<ul>
<li><p>Single Sign-On based on the current EBS User’s Session.</p>
</li>
<li><p>Embeddable APEX Application inside Oracle EBS or Standalone if needed.</p>
</li>
<li><p>EBS integrated screens to manage the links between the EBS functions and APEX Applications in certain Workspaces and their target Pages.</p>
</li>
<li><p>Oracle APEX Schema registration with EBS.</p>
</li>
<li><p>Registering APEX_PUBLIC_USER to allow certain EBS APIs to work seamlessly with Oracle APEX.</p>
</li>
</ul>
<p>Those were great additions that made the integration and writing extensions for EBS using Oracle APEX easier.</p>
<p>While the current patches will insure that the logged in APEX Users are having access to the Responsibility and Function that they navigated from EBS to APEX respected in the APEX Application, the current technical paper doesn’t include yet, the ability to have a granular authorization access inside an APEX application using arbitrary EBS Responsibilities and Functions.</p>
<p>In this blog post I provide such function. The function takes a couple of parameters. The first one will check if the current APEX user is having a certain EBS Responsibility. The other will check if the current APEX user is having access to a certain EBS Function.</p>
<p>Below is the Spec for the “has_responsibility_or_function” function.</p>
<pre><code class="lang-sql"><span class="hljs-keyword">create</span> <span class="hljs-keyword">or</span> <span class="hljs-keyword">replace</span> <span class="hljs-keyword">package</span> FND_APEX <span class="hljs-keyword">AUTHID</span> DEFINER <span class="hljs-keyword">as</span>

<span class="hljs-keyword">FUNCTION</span> <span class="hljs-keyword">authentication</span> <span class="hljs-keyword">RETURN</span> <span class="hljs-built_in">BOOLEAN</span>;

FUNCTION authorization RETURN BOOLEAN;

FUNCTION has_responsibility_or_function(p_user_name      IN VARCHAR2,
    p_resp_key       IN VARCHAR2 DEFAULT NULL,
    p_function_name  IN VARCHAR2 DEFAULT NULL) RETURN BOOLEAN;

<span class="hljs-keyword">end</span> FND_APEX;
</code></pre>
<p>The implementation for the function could look something like the following code:</p>
<pre><code class="lang-sql">   <span class="hljs-comment">/*
      SHLAYEL: This function tests a responsibility or function for a logged APEX user
   */</span>

   FUNCTION has_responsibility_or_function (
    p_user_name      IN VARCHAR2,
    p_resp_key       IN VARCHAR2 DEFAULT NULL,
    p_function_name  IN VARCHAR2 DEFAULT NULL
   ) RETURN BOOLEAN IS
      l_count INTEGER := 0;
   <span class="hljs-keyword">BEGIN</span>
      <span class="hljs-comment">-- Check if the user has the specified responsibility</span>
      <span class="hljs-keyword">IF</span> p_resp_key <span class="hljs-keyword">IS</span> <span class="hljs-keyword">NOT</span> <span class="hljs-literal">NULL</span> <span class="hljs-keyword">THEN</span>
         <span class="hljs-keyword">SELECT</span> <span class="hljs-keyword">COUNT</span>(*)
         <span class="hljs-keyword">INTO</span> l_count
         <span class="hljs-keyword">FROM</span> fnd_user u
         <span class="hljs-keyword">JOIN</span> fnd_user_resp_groups g
               <span class="hljs-keyword">ON</span> u.user_id = g.user_id
         <span class="hljs-keyword">JOIN</span> fnd_responsibility r
               <span class="hljs-keyword">ON</span> g.responsibility_id = r.responsibility_id
         <span class="hljs-keyword">WHERE</span> u.user_name = <span class="hljs-keyword">UPPER</span>(p_user_name)
            <span class="hljs-keyword">AND</span> r.responsibility_key = <span class="hljs-keyword">UPPER</span>(p_resp_key)
            <span class="hljs-keyword">AND</span> <span class="hljs-keyword">SYSDATE</span> <span class="hljs-keyword">BETWEEN</span> g.start_date <span class="hljs-keyword">AND</span> NVL(g.end_date, <span class="hljs-keyword">SYSDATE</span> + <span class="hljs-number">1</span>);

         IF l_count &gt; 0 THEN
               RETURN TRUE;
         <span class="hljs-keyword">END</span> <span class="hljs-keyword">IF</span>;
      <span class="hljs-keyword">END</span> <span class="hljs-keyword">IF</span>;

      <span class="hljs-comment">-- Check if the user has the specified function</span>
      IF p_function_name IS NOT NULL THEN
        IF fnd_function.test(p_function_name) THEN
            RETURN TRUE;
        <span class="hljs-keyword">END</span> <span class="hljs-keyword">IF</span>;
      <span class="hljs-keyword">END</span> <span class="hljs-keyword">IF</span>;

      RETURN FALSE;

   EXCEPTION
      WHEN OTHERS THEN
         RETURN FALSE;
   <span class="hljs-keyword">END</span>;
</code></pre>
<p>Now it is much easier to fine tune the authorization for a page, region, item, or properties in Oracle APEX based on an EBS responsibility or function.</p>
<p>For instance, I could use the following code to make a Page Item “Read Only” if I do not have the “XX_APEX_RESPONSIBILITY” assigned to the current APEX user.</p>
<pre><code class="lang-sql"><span class="hljs-comment">-- Check if user has a responsibility</span>
IF apps.fnd_apex.has_responsibility_or_function(:APP_USER, p_resp_key =&gt; 'XX_APEX_RESP') THEN
    RETURN FALSE;
ELSE 
    RETURN TRUE;
<span class="hljs-keyword">END</span> <span class="hljs-keyword">IF</span>;
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1748937137659/2632c6ca-302c-407e-a51f-4684ae9971c8.png" alt class="image--center mx-auto" /></p>
<p>I am currently working closely with the EBS team to have this as part of the patch and make it included in the FND_APEX package.</p>
<p>I am also working on an Authorization Plugin that will be available in the near future that will have even more cooler features.</p>
<p>Stay tuned, and Happy APEXing!</p>
]]></content:encoded></item></channel></rss>