Home » Developer & Programmer » Forms » how to enable/disable button through coding (oracle forms 10g, windows 2k)
how to enable/disable button through coding [message #311074] Thu, 03 April 2008 06:21 Go to next message
mksenthil
Messages: 15
Registered: February 2008
Location: chennai
Junior Member
Hi all,


I want to enable/disable buttons depending up on the users.

if the user is an admin then all the buttons should be enabled and the user other than admin i want to disable button(like insert, update, delete buttons).


can any one help me.....



thanks

senthil

Re: how to enable/disable button through coding [message #311075 is a reply to message #311074] Thu, 03 April 2008 06:28 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
By Administrator you mean to say DBA right? If yes then what you are trying to do is to check that current user has DBA previliges or not.

For this there is a view called user_role_privs. The view holds the roles assigned to current user.

Use the following query:

SELECT COUNT(*) INTO v_count FROM user_role_privs
WHERE username = UPPER(p_user_id)
AND granted_role IN ('DBA', 'SA_ADMIN_ROLE');

If the v_count is greater then zero then enable the button else disable it.

Regards,
Azam Khan
Re: how to enable/disable button through coding [message #311131 is a reply to message #311074] Thu, 03 April 2008 09:05 Go to previous message
jtataji
Messages: 4
Registered: March 2008
Junior Member
Write a form level trigger based on user id.
like if user_id=admin
then
set item property to enable
else
set item property to enable


some thing like this.


Regards,
Tataji.
Previous Topic: Problem on insert using a rowtype variable
Next Topic: Select query problem in form
Goto Forum:
  


Current Time: Sat Feb 15 22:58:43 CST 2025