我正在尝试在我使用MySQL开发的row应用程序上模拟行级安全性。
使用此方法:使用所需的表创建一个数据库,其中将存储与所有用户有关的数据,并对表中的列进行适当的索引。
基于用户id为特定用户创建mysql“视图”。
为了实现行级安全性,我还必须为每个用户创建mysql帐户,并在视图上设置“授予”权限。
对于web界面,将使用基于PHP的MVC框架。
但是,根据我的研究:
1] Having separate mysql account per user "make the webapp less secure".
2] Having separate mysql account per user "increases the disk I/O".
问题:
1] How does creating mysql user per webapp user make the webapp less secure?
2] Does the disk I/O increase considerably?
3] Is there a better way to implement row-level-security in MySQL?
4] What are the pros/cons of implementing row-level-security by the above method?
为什么我要关注行级安全性?
I need row level security because there are rows which will be shared between multiple users & have 1 or 2 owners to it. Only these owners can delete/modify them.
发布于 2011-11-28 22:34:38
我的观点是:
1] How does creating mysql user per webapp user make the webapp less secure?
数据库有多个入口点。它不同于在其中存储用户信息的users表,然后使用他们都使用的受到适当限制的mysql帐户(作为web应用配置文件的一部分)。
2] Does the disk I/O increase considerably?
我不确定如何正确回答这个问题,因为您可能读过的那篇文章是关于开发人员/数据库管理员等使用多个sql帐户directly访问您的数据库的。
3] Is there a better way to implement row-level-security in MySQL?
在您的MySQL实现中使用SQL函数和视图,也许您可以尝试通过表数据来控制用户访问,而不是从SQL帐户级别进行访问。
4] What are the pros/cons of implementing row-level-security by the above method?
拥有多个帐户的结果之一是维护帐户。
使用视图、函数和存储过程将是帮助控制允许访问者查看的数据量或数据种类的一种好方法,因此这是一个专业的方法。
同样,这些只是我的观点;我可能误解了一些部分,我可能对其他部分也是错误的。:)
发布于 2011-11-29 04:42:17
问题3的答案是:
一种更简单的方法可能是使用单独的表。它可能在性能方面也会更好。你想把数据放在同一张表里有什么原因吗?据我所知,用户之间不共享任何行。
https://stackoverflow.com/questions/8296821
复制相似问题