且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

限制某些用户只能访问公共表中的数据

更新时间:2023-12-01 23:38:34

感谢 Frank Schmitt 这个答案,但他似乎不想写一篇,所以我可以接受:(

Credit to Frank Schmitt for this answer, but he doesn't seem to want to write one up so I can accept it :(

在视图内部,您可以使用 user() 函数来过滤数据(这样,每个数据库表只需要一个视图,而不是每个数据库表和客户一个视图).

Inside the view, you could possibly use the user() function to filter the data (this way, you need only one view per DB table, instead of one view per DB table and customer).