Oracle Database Roles and Oracle Forms

camposaa
camposaa used Ask the Experts™
on
I am still working on my development environment...I have my forms running on the web.  After a user connected to the DB, a form opens with 10 different push buttons that allows them to go to other forms.  Well what I am trying to do is, depending on the their role (I created 6), only certain buttons will be enabled.  Like the Admin can click on them all of course, but like a certain user has privileges to click say on only 5 buttons.  Right now everyone can click on every button but I want to fix this. I am trying to code the logic in my trigger, when_new_instance and I know that I have to set_item_property to false is they are not supposed to do this but I am having problems trying to return there role to my application so that in my logic, I can say like:  If role = xxxxx, then set_item_property...blah blah...Any ideas?  Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
first set allowed_to_run = false for all buttons.

then

SELECT granted_role FROM dba_role_privs WHERE grantee = USER

if granted_role = a known role, then set aloowed_to_run = true

hth
randy

Author

Commented:
I've tried that, my statement looks like

SET_ITEM_PROPERTY('CONTROL.BUTTON_ALR', ENABLED, PROPERTY_FALSE);

But I keep getting an error,

FRM-41032:  Cannot set ENABLED attribute of current item %s.%s.

Cause:     A call to SET_ITEM_PROPERTY attempted to set the Enabled attribute of the current item.

Action:     Either correct the call to SET_ITEM_PROPERTY or navigate to another item before setting the Enabled attribute.

Level:     >25

Any ideas?

Type:     Error
Commented:
>>FRM-41032:  Cannot set ENABLED attribute of current item %s.%s.

Navigate out of current item before issuing the SET_ITEM_PROPERTY statement. If it is the first item, use something like GO_ITEM to move to the next item.


HTH

Ali

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial