MySQL Forums
Forum List  »  General

Re: Using views for access control. How?
Posted by: herrderfliegen
Date: March 31, 2006 01:37AM

I'm not exactly sure, what you are trying to achieve, but here's an alternate solution (using a single view):

if your tables contain a column named user, you can do access control like this

create or replace view _yourview as select * from _whatever where user=current_user;

there's only on drawback:
query cache won't work anymore, because of the current_user statement


PS.: (@ mysql staff)
why doesn't the query cache generate an entry for each different value of a variable?
using any kind of variable/function with return value in a query effectively disables the cache



Edited 1 time(s). Last edit at 03/31/2006 03:13AM by herrderfliegen.

Options: ReplyQuote


Subject
Written By
Posted
December 22, 2005 04:43AM
Re: Using views for access control. How?
March 31, 2006 01:37AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.