In MySQL 5.x, is it possible to grant permissions based on conditions (not using views)?

In a project I am running, I would like to grant privileges to users based on certain conditions, for example (on a specific table):

  • can read all lines
  • cannot write to lines with id <x, but can WRITE to line> = x
  • etc...

I would like to avoid views as these conditions can change for each user (I understand that I would need to create a view for each case) I would also like to avoid enforcing this on the client side as it could be easily worked around.

If this is not possible, what kind of job would you offer?

Thank you very much in advance.

0


source to share


1 answer


I don't think this is possible with the raw MySQL privilege system.



As long as you don't want to implement it on the client side, changing your MySQL code may be your only option. It's open source;)

+1


source







All Articles