Home » Developer & Programmer » Forms » Employee Access / Authority (Windows XP)
Employee Access / Authority [message #502988] Tue, 12 April 2011 02:44 Go to next message
adeelali
Messages: 10
Registered: April 2011
Location: Pakistan
Junior Member

I have create one table "Emp_Access"
in this table we insert employee for access on form

=====================================

EMP_ID----SYS_ID--------APP_ID
85--------- 1 ----------- 2 --
85--------- 1 ----------- 1 --
85--------- 1 ----------- 3 --

=====================================
we give access to emplyee at app_id
then tell me
If one employee has access on three forms then
how to get access of employee
For Example employee has access at two or three forms
then how to know employee has access at form 1 and form 3
or at form 1, form 2 and form 3 ...
because
I want to call another forms from this (APP_ID) ID's

Thanks & Regards
Syed Adeel Ali

Re: Employee Access / Authority [message #502989 is a reply to message #502988] Tue, 12 April 2011 02:49 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As you have a table that tells which employee is authorized to use which form, you could perform query and see whether hi/she is allowed to call a certain form or not. If a form is called through a push button, that code would be part of the WHEN-BUTTON-PRESSED trigger. Also, perhaps you could even perform check upon entering that "menu" form and hide certain buttons (SET_ITEM_PROPERTY built-in).

Sorry if I misunderstood the question.
Re: Employee Access / Authority [message #502992 is a reply to message #502989] Tue, 12 April 2011 03:04 Go to previous messageGo to next message
adeelali
Messages: 10
Registered: April 2011
Location: Pakistan
Junior Member

Littlefoot wrote on Tue, 12 April 2011 12:49
As you have a table that tells which employee is authorized to use which form, you could perform query and see whether hi/she is allowed to call a certain form or not. If a form is called through a push button, that code would be part of the WHEN-BUTTON-PRESSED trigger. Also, perhaps you could even perform check upon entering that "menu" form and hide certain buttons (SET_ITEM_PROPERTY built-in).

Sorry if I misunderstood the question.


Ya! You are right because I want to call another form which will depend on menu buttons
So tell me how to know from query that employee no 85 or other has authority of 3 forms
And on which forms (forms Id)
Don't use count logic here ..

Re: Employee Access / Authority [message #502995 is a reply to message #502992] Tue, 12 April 2011 03:17 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
You're asking us?
Create the table in such a way that'll hold all the information you need.
What exactly is the problem?
Re: Employee Access / Authority [message #503010 is a reply to message #502995] Tue, 12 April 2011 04:21 Go to previous message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Regarding a table you posted, perhaps you could create a function (which would then be called from every button):
function check_privileges(par_emp_id in number, par_app_id in number)
  return boolean
is
  l_var number;
begin
  select null
    into l_var
    from your_table
    where emp_id = par_emp_id
      and app_id = par_app_id;

  return (true);
exception
  when no_data_found then
    return (false);
end;

WHEN-BUTTON-PRESSED on every form button (you should know which form (i.e. APP_ID) it is supposed to call) would then look like this:
-- :THIS_EMP_ID represents current employee
-- 2 is a form whose APP_ID = 2

if check_privileges(:this_emp_id, 2) then
   call_form('form_2');
else
   message('You are not allowed to run this form');
   raise form_trigger_failure;
end if;
Previous Topic: Forms
Next Topic: how to protect my source query in forms trigger
Goto Forum:
  


Current Time: Mon Sep 16 13:06:31 CDT 2024