Re: Q. Granting Priveleges in Oracle

From: <ps_at_netvigator.com>
Date: 1996/07/14
Message-ID: <4sb1d9$6t9_at_imsp003.netvigator.com>#1/1


> jagan <jagan_kodali_at_non-hp-paloalto-om2.om.hp.com> writes:
> Hello,
>
> I'd like to know if there is any way to grant priveleges in Oracle to
> alter a row in a table only if that row has been inserted by that user.
>
> For example: If an agent "A" handles customer "C", Customer "C" record
> should only be altered by agent "A"
>
> A way I can think of is inserting an attribute in the customer table
> showing who the agent is and let the application take care of this
> access.
>
> Any ideas if there is a better way or if there is a GRANT privelege in
> Oracle that can accomplish this task.
>
> Thanks, in advance.
>
> Jagan Kodali
> (408)985-2750
>

>>>>
You may try to add a new column(e.g. OWNER) in your table for storing the user login name. Then instead of granting privileges to that table, creat a view on that table with the condition "where OWNER=USER", where user is Oracle build in function of the current user login name. Then you may only grant privileges on that view to your user. The current user only have the privileges to alter the view and the view allows he/she to access his/her row only. That's it.

P.S.

~~~~~ ~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~ ~~~~~~~~~
 ~~ Life is always Hard ~~~~~~~~~ ~~~~~~ ~~~~~ ¥Í¬¡±q¤£»´ÃP ~~~~~~ ~~~~~~~
  ~~~ Love is never Smooth ~~ ~~~~~~~~~~~~~ ~~~~ ·R±¡§ó«D©Z³~ ~~~~~~~~~~~~~~
   ~~~~ Always Love hard and never Life smooth ~~~ °ß¦³¼ö¤Á¦a·R,Åý¥Í©R§óºëªö ~
    ~~~~~~~~ ~~~~~ ~~~ ~~~~~~~~~~~~~~~ ~~~~ ~~~~~~~~~~~~ ~~~~~~~~~~~~~~ ~~~~~~~~
     ~~~~ ~~~~~~~~~~~~~~~~~~~~~ ~~ ~~~~~~~~~~~ ~~~~~~~~ ~~~~~~~ ~~~ P.S. ~~~~~
                                                      ~~~~ ~~~~~~~~~~ ~~~~~~
Received on Sun Jul 14 1996 - 00:00:00 CEST

Original text of this message