Re: Row-level security?

From: lawpoop <>
Date: Mon, 1 Jun 2009 08:00:45 -0700 (PDT)
Message-ID: <>

On May 29, 3:27 pm, Bob Badour <> 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