Re: Row-level security?

From: lawpoop <lawpoop_at_gmail.com>
Date: Mon, 1 Jun 2009 08:00:45 -0700 (PDT)
Message-ID: <3788a5d4-2be2-4cc5-8757-715f35ff5e70_at_s16g2000vbp.googlegroups.com>


On May 29, 3:27 pm, Bob Badour <bbad..._at_pei.sympatico.ca> wrote:
>
> > What one would need to do, then, is create a table of user permissions
> > that has a column of the MySQL username and the client_id, or whatever
> > column you would want to use in restricting on the query. Then create
> > a view that in some place references a join to that table, and puts
> > WHERE username = USER() or whatever in the view's where clause.
>
> > Correct?
>
> This assumes you connect to the dbms with a different user name for each
> client. Do you do that?

Yes, this does assume that. Are there other ways of doing this?

 I'm not asking "How do I do that in the setup I currently have", but rather "What [is|are] the way[s] this is done?"

If you didn't have a separate dbms username for each user for whom you want to implement row-level security, it seems to me that it can't be done in SQL alone, for MySQL. In other words, in MySQL, you couldn't create a row-level security system just with tables, queries and views alone. You have to use users. Received on Mon Jun 01 2009 - 17:00:45 CEST

Original text of this message