Re: Form 6: How to use menu item tole in application?

From: Eric Givler <egivler_at_flash.net>
Date: Thu, 16 Nov 2000 13:17:43 GMT
Message-ID: <X7RQ5.2851$6W1.181762_at_news.flash.net>


> I have checked that the "frm60sec.sql" script provided with the Form6.0
 for
> building the FRM60_ENABLED_ROLES view does base on sys.user_role_privs not
> the session_roles.
>
> Is it possible and safe to adapt the script to base the view on
> session_roles ? If it is okay the problem would be solved.

Never tried doing this, but it makes some sense. You would think you could go into the form, enable the roles that you want, then issue a replace_menu (or something like that) and see the resulting affects on the menu. Have you tried it?

> On the alternative of rebuilding the menu at run-time, I did not know it
 is
> possible. Thanks for the info, Eric. Please give me some more pointers on
> how it can be done. What programming effort is involved ?
 

> Anyway, in this case i would rather read the info from an applicaton table
> than from the system's roles tables.

This may seem like a LOT of extra work, but you could store each menu item/choice into a table:
create table my_menu_security(

   menu_item_choice varchar2(60),

   rolename               varchar2(30),
   security_level         number)

The security_level could be 0 = not displayed, 1 - displayed but gray, 2 - displayed and accessible
Rolename is simply a list of your application roles. Menu_item_choice would be MENUNAME.Menu_ItemName, ie. REVENUE_MENU.GIVE_MONEY_AWAY Now, loop through all the records in this table :

procedure adjust_the_menu is

   SecurityLevel number;
begin

     for menu_security_rec in ( select distinct menu_item_choice from my_menu_security )

     loop
          SecurityLevel :=
etMenuSecurity( menu_security_rec.menu_item_choice );
          if nvl(SecurityLevel, 0) = 0 then
              set_menu_item_property ( menu_security_rec.menu_item_choice,
DISPLAYED,
                   PROPERTY_OFF );
          elsif SecurityLevel = 1 then
              set_menu_item_property ( menu_security_rec.menu_item_choice,
ENABLED,
                  PROPERTY_OFF );
          else
                 -- by default everything is displayed so nothing to do
here.
                 null;
         end if;

  end loop;
end adjust_the_menu;

> On the view FRM60_ENABLED_ROLES, why does Oracle keep ungrading the name
 of
> the view? I last know it as FRM45_ENABLED_ROLES. Perhap there was a
> FRM50--- and more to come ?

NOT SURE HERE. Received on Thu Nov 16 2000 - 14:17:43 CET

Original text of this message