I found DBMS_SESSION.IS_ROLE_ENABLED a very interesting function which the last time I’ve used, it helped me overcome a security problem.
The standrads applied in the compagny I was working for did not allow select on dba roles and priviledges tables. When I have developed an oracle forms I was told to enable or disable the commit button depending on the role of the connected user. As far as those standards prevent me for doing select on those specific tables, I turned arround and decide to make use of DBMS_SESSION as follows
In a when new form instance trigger
BEGIN IF DBMS_SESSION.IS_ROLE_ENABLED('The_Role_Name_Allowing_Commit') THEN SET_ITEM_PROPERTY('BLOCK.BUTTON',ENABLED, PROPERTY_TRUE); ELSE SET_ITEM_PROPERTY('BLOCK.BUTTON',ENABLED, PROPERTY_FALSE); END IF; END;