since I'm using forms, I don't want to use views, since I would be constantly changing the base table on blocks. There are lots of tables beneath the department level that all need the same security.
if I use pl/sql routines to perform all the dml, does that mean making all my forms blocks non-base table blocks and sending all the field data to the procedures?
I hoped there would be a way to achieve this without radically changing the forms.
Main Topics
Browse All Topics





by: frankrPosted on 1997-11-11 at 14:12:56ID: 1080793
There are a couple of ways you could approach this.
The classic approach is to grant SELECT against the table itself,
and grant SELECT, INSERT, UPDATE, DELETE against a view which
filters out only those rows in the users own dept, e.g.
SELECT tt.col1, ... , tt.coln
FROM target_table tt, emp
WHERE tt.dept = emp.dept
AND emp.lastname = USER
This assumes both the emp and target_table has a dept column, and
that you can associate the system variable 'USER' with some
column from emp... You could grant these privs to roles or to
user accounts directly.
If you're using Forms to access the data, there's still the
problem of referencing both the original table (not updateable)
and the view from the same form. Which is the base table?
It's probably easiest to dedicate one form to query-only, and
another to updates, the former using the table for a base table and the latter using the updateable view.
You could also create a database PL/SQL routine to perform all
the DML. Grant SELECT to all users, and have some stored module
perform the actual updates in proxy for the users. One of the
things it could check is that the user is in the group before
processing any updates. Then the owner of the database module
needs DML privs on the table and those who perform updates need
EXECUTE priv (the security is implemented in the code, and
enforced procedurally). This is far more flexible - there's
virtually no limit to what you could do - but it's also more
complex.