Professional Web Applications Themes

Granting rights on specific tuples? - MySQL

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...

  1. #1

    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


    Matthijs Holter Guest

  2. #2

    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.
    [url]http://dev.mysql.com/doc/refman/5.0/en/create-view.html[/url]

    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
    [url]http://www.livejournal.com/users/arjen_lentz/49881.html[/url]

    ciao
    gmax

    --
    _ _ _ _
    (_|| | |(_|><
    _|
    [url]http://gmax.oltrelinux.com[/url]
    Giuseppe Maxia Guest

  3. #3

    Default Re: Granting rights on specific tuples?

    Thanks, Giuseppe!

    - Matthijs

    "Giuseppe Maxia" <gmax__cpan_._org> skrev i melding
    news:4369f57a$0$22301$4fafbaefreader1.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.
    > [url]http://dev.mysql.com/doc/refman/5.0/en/create-view.html[/url]
    >
    > 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
    > [url]http://www.livejournal.com/users/arjen_lentz/49881.html[/url]
    >
    > ciao
    > gmax
    >
    > --
    > _ _ _ _
    > (_|| | |(_|><
    > _|
    > [url]http://gmax.oltrelinux.com[/url]

    Matthijs Holter Guest

  4. #4

    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?
    Christian Kirsch Guest

  5. #5

    Default Re: Granting rights on specific tuples?

    "Christian Kirsch" <ckbru6.de> skrev i melding
    news:436a5192$0$21941$9b4e6d93newsread2.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


    Matthijs Holter Guest

  6. #6

    Default Re: Granting rights on specific tuples?

    On Fri, 04 Nov 2005 16:41:23 GMT, "Matthijs Holter"
    <fjernspam.matthijs1000fjernspam.hotmail.com> wrote:
    >"Christian Kirsch" <ckbru6.de> skrev i melding
    >news:436a5192$0$21941$9b4e6d93newsread2.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)
    Kees Nuyt Guest

Similar Threads

  1. How? Granting elevated privileges to a web service / kill a process
    By Lee Gillie in forum ASP.NET Web Services
    Replies: 1
    Last Post: May 13th, 12:48 PM
  2. Replies: 0
    Last Post: January 7th, 10:56 PM
  3. Is granting Modify permission on root folder secure?
    By PWSkamp in forum ASP Components
    Replies: 1
    Last Post: January 4th, 12:51 AM
  4. count tuples for Oracle?
    By Bob Showalter in forum PERL Beginners
    Replies: 0
    Last Post: August 29th, 12:15 PM
  5. granting right to passwd
    By Kevin in forum Sun Solaris
    Replies: 1
    Last Post: June 26th, 04:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139