Howto: Privilegs based on foreign key of a column?? [message #390139] |
Thu, 05 March 2009 02:32  |
roithi
Messages: 8 Registered: March 2006
|
Junior Member |
|
|
Hi guys!
I have the following situation
Two tables, created in the schema "student_admin"
COURSE
courseID
teacherID
....
TEACHER
teacherID
name
....
Is it now possible to set restriction, that a teacher can only edit and see course data he is assigned to? - and how can i do this?
I know how i can grant privilegs to table of a different schema, but i have no clou how i can grant privilegs to a table based on the foreign key
thanks for your help,
|
|
|
|
Re: Howto: Privilegs based on foreign key of a column?? [message #390186 is a reply to message #390148] |
Thu, 05 March 2009 06:37   |
roithi
Messages: 8 Registered: March 2006
|
Junior Member |
|
|
I know that there is no relation between Data in Tables and the Access to them.
I'm trying to find out how such restrictions could be applied, and if it's possible to implement something in oracle
i try to describe it better now:
e.g: a table that contains all Student's data
table: students (id, name, adress, orauser)
id name address orauser
1 test1 somewhere scott_1
2 test2 somewhere2 scott_2
3 test3 somewhere3 scott_3
If the student "test1" with his oracle user "scott_1" logs in to the database, and perform select * from students, he should only see all rows with his ora_user
And i don't know if something like this is even possible... actually i should be somehow possible with a view, isn't it?
|
|
|
Re: Howto: Privilegs based on foreign key of a column?? [message #390193 is a reply to message #390186] |
Thu, 05 March 2009 06:52  |
 |
Michel Cadot
Messages: 68737 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote: | If the student "test1" with his oracle user "scott_1" logs in to the database, and perform select * from students, he should only see all rows with his ora_user
|
Now this has sense.
You can use a view upon your table that restricts access to allowed data and don't allow to directly access to the table.
Regards
Michel
[Updated on: Thu, 05 March 2009 06:53] Report message to a moderator
|
|
|