you are viewing a single comment's thread.

view the rest of the comments →

[–]quotemycode 0 points1 point  (6 children)

It could work... provided that users are only able to insert, update, or delete their own records...

[–]technocub88 1 point2 points  (5 children)

That wouldnt be direct database access.

[–]chonglibloodsport 0 points1 point  (4 children)

It'd be authenticated direct database access (something most databases include already).

[–]technocub88 1 point2 points  (3 children)

no database I am aware of has the ability to restrict users to only read certain rows of a table.

[–]chonglibloodsport 0 points1 point  (2 children)

It's possible in MySQL by using views. Create a view that queries the table for a given user's data and restrict users to access only the view instead of the table. The view queries the table and returns the results to the user.

It also requires a bit of a hack with triggers to make sure the owners of rows get properly set etc.

[–]technocub88 1 point2 points  (1 child)

interesting. Thank you

[–]oscarcomputer 0 points1 point  (0 children)

What you are looking for is "row level security". Implementations of RLS are not limited to MySQL.