Unix Technical Forum

Granting rights on specific tuples?

This is a discussion on Granting rights on specific tuples? within the MySQL forums, part of the Database Server Software category; --> Hi! I'm setting up a multi-user system where I want different users to have access to different tuples in ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 07:06 AM
Matthijs Holter
 
Posts: n/a
Default Granting rights on specific tuples?

Hi!

I'm setting up a multi-user system where I want different users to have
access to different tuples in the same schema. So that, for instance, userA
and userB both have access to the schema "Cars (color, age)", but only userA
has access to "car1 red 12" and userB has access to "car2 blue 1".

Is there any way to set these rights in SQL?

- Matthijs


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 07:06 AM
Giuseppe Maxia
 
Posts: n/a
Default Re: Granting rights on specific tuples?

Matthijs Holter wrote:
> Hi!
>
> I'm setting up a multi-user system where I want different users to have
> access to different tuples in the same schema. So that, for instance, userA
> and userB both have access to the schema "Cars (color, age)", but only userA
> has access to "car1 red 12" and userB has access to "car2 blue 1".
>
> Is there any way to set these rights in SQL?
>
> - Matthijs
>
>


Yes. Using views.
http://dev.mysql.com/doc/refman/5.0/en/create-view.html

Don't give access to the table, but create as many views as you need
to implement your profiles, and then give rights to these views
(they could be updatable also).

You can also enforce a constraint
http://www.livejournal.com/users/arjen_lentz/49881.html

ciao
gmax

--
_ _ _ _
(_|| | |(_|><
_|
http://gmax.oltrelinux.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 07:06 AM
Matthijs Holter
 
Posts: n/a
Default Re: Granting rights on specific tuples?

Thanks, Giuseppe!

- Matthijs

"Giuseppe Maxia" <gmax_@_cpan_._org> skrev i melding
news:4369f57a$0$22301$4fafbaef@reader1.news.tin.it ...
> Matthijs Holter wrote:
>> Hi!
>>
>> I'm setting up a multi-user system where I want different users to have
>> access to different tuples in the same schema. So that, for instance,
>> userA and userB both have access to the schema "Cars (color, age)", but
>> only userA has access to "car1 red 12" and userB has access to "car2 blue
>> 1".
>>
>> Is there any way to set these rights in SQL?
>>
>> - Matthijs

>
> Yes. Using views.
> http://dev.mysql.com/doc/refman/5.0/en/create-view.html
>
> Don't give access to the table, but create as many views as you need
> to implement your profiles, and then give rights to these views
> (they could be updatable also).
>
> You can also enforce a constraint
> http://www.livejournal.com/users/arjen_lentz/49881.html
>
> ciao
> gmax
>
> --
> _ _ _ _
> (_|| | |(_|><
> _|
> http://gmax.oltrelinux.com



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 07:07 AM
Christian Kirsch
 
Posts: n/a
Default Re: Granting rights on specific tuples?

Matthijs Holter wrote:
> Hi!
>
> I'm setting up a multi-user system where I want different users to have
> access to different tuples in the same schema. So that, for instance, userA
> and userB both have access to the schema "Cars (color, age)", but only userA
> has access to "car1 red 12" and userB has access to "car2 blue 1".
>


How's that supposed to work for tuples that don't exist yet?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-28-2008, 07:07 AM
Matthijs Holter
 
Posts: n/a
Default Re: Granting rights on specific tuples?

"Christian Kirsch" <ck@bru6.de> skrev i melding
news:436a5192$0$21941$9b4e6d93@newsread2.arcor-online.net...
> Matthijs Holter wrote:
>> Hi!
>>
>> I'm setting up a multi-user system where I want different users to have
>> access to different tuples in the same schema. So that, for instance,
>> userA
>> and userB both have access to the schema "Cars (color, age)", but only
>> userA
>> has access to "car1 red 12" and userB has access to "car2 blue 1".
>>

>
> How's that supposed to work for tuples that don't exist yet?


I was thinking that when a tuple is created, it is assigned to an owner. So
when userB is logged in and creates a new tuple, only he can access it.

- Matthijs


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-28-2008, 07:07 AM
Kees Nuyt
 
Posts: n/a
Default Re: Granting rights on specific tuples?

On Fri, 04 Nov 2005 16:41:23 GMT, "Matthijs Holter"
<fjernspam.matthijs1000@fjernspam.hotmail.com> wrote:

>"Christian Kirsch" <ck@bru6.de> skrev i melding
>news:436a5192$0$21941$9b4e6d93@newsread2.arcor-online.net...
>> Matthijs Holter wrote:
>>> Hi!
>>>
>>> I'm setting up a multi-user system where I want different users to have
>>> access to different tuples in the same schema. So that, for instance,
>>> userA
>>> and userB both have access to the schema "Cars (color, age)", but only
>>> userA
>>> has access to "car1 red 12" and userB has access to "car2 blue 1".
>>>

>>
>> How's that supposed to work for tuples that don't exist yet?

>
>I was thinking that when a tuple is created, it is assigned to an owner. So
>when userB is logged in and creates a new tuple, only he can access it.
>
>- Matthijs


You can do it that way by adding the userID to the table as long
as (user : tuple) = (1 : many), not (many : many).

You wouldn't need a per-user view in that case.

SQL itself only defines per column privileges, not per row.
--
( Kees
)
c[_] Is "tired old cliche" one? (#11)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:42 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com