3 Replies Latest reply: Oct 9, 2012 5:54 AM by Mindmap RSS

    How do enable items based on logged user

    J-Oracle
      Hello All,

      Env: Apex 4.2

      I have a form where in i want to enable few items only for 2 users.

      How do i enable/disable items based on the user who had logged in ?

      TIA,
      J
        • 1. Re: How do enable items based on logged user
          Mindmap
          Hi J,

          You could have searched the forum. However, In case you want to make your items not available at all then,
          The easiest way is to create Authorization Schema.
          Please see {thread:id=2447942}
          Where you can find a link for videos ..

          If you want to show your items, but they are disabled so the end user cannot change them,
          Then you need to use DA (Dynamic Actoins)

          Best Regards,
          Fateh
          • 2. Re: How do enable items based on logged user
            J-Oracle
            Hello Fateh,

            Thx for stopping by.

            I use SSO for authentication, so i cannot user the APEX_UTIL.CURRENT_USER_IN_GROUP (i guess).

            Or is there a workaround ?

            I tried to use the below in the authorisation. But agian, the item doesn't display even while logged in as myself.
            return (v('APP_USER') in ('id1', 'id2', 'id3'... 'idx'));

            Again, is it possible to use Dynamic Actions to disable items based on the value of v('APP_USER') ??


            TIA,
            J

            Edited by: J on 09-Oct-2012 03:20

            Edited by: J on 09-Oct-2012 03:21
            • 3. Re: How do enable items based on logged user
              Mindmap
              Hi,
              Before I get to know about APEX_UTIL...
              I use to do something similar to this:

              Put the names of my endusers in a table
              Create table end_users (ID number, user_name varchar2 (50), flat varchar2 (1));
              In the DA Condition, use SQL query returning at least one row:
              Select 1 from end_users where upper (:app_user) in select upper (user_name) from end_users where flag = ....
              You modify the Condition type or the Previous SQL statement according to your needs ...

              Best Regards,
              FAteh