| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: record level permissions
Hi,
Add column to your table:
username varchar2(30)
Fill it with user on insert. Create view with check option limited on username. Grant access on the view to users. Do not grant access on the original table. All users must work only with the view.
SVRMGR> drop table test_perm;
Statement processed.
SVRMGR> create table test_perm
2> (id integer
3> ,name varchar2(30)
4> ,username varchar2(30) default user
5> );
SVRMGR> create or replace view v_test_perm
2> (id
3> ,name
4> )
5> as
6> select id,name
7> from test_perm
8> where username=user
9> with check option;
---------- ------------------------------
1 SMITH
2 BLACK
3 BROWN
---------- ------------------------------
4 CLARK
5 JACKSON
6 PATTON
---------- ------------------------------
7 GATES
8 ELLISON
9 GROWER
As you see, each user has access only to his rows. He can not select,update or delete rows of other users.
Andrew Protasov
> Here is my problem.
>
> I have several flatfiles that I want to load into the same database table.
> However each flatfile is owned by a different user. I would like to allow
> users to only be able to access their own data within the table.
>
> I know I could replicate the data for each user or I could include an
> attribute to denote ownership.
>
> However, I was wondering if Oracle 8 Enterprise Server supported some form of
> record level permissions - where I could permit a user to access a record or
> group of records within a table.
>
> Im looking for the following? 1. Is this possible - is there a built in
> method for this. 2. What Oracle documentation would describe this feature. 3.
> Any examples or insight into this problem. 4. What tool I can use to
> manipulate these permissions ? ie Enterprise Manager? - can I assign the
> permissions on load with SQL Loader ? Thanks Kevin Rose
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
>
Received on Wed Dec 02 1998 - 14:25:34 CST
![]() |
![]() |