我想模擬我使用MySQL開發的webapp上的行級安全性。Webapp:Mysql:行級安全性。 PRO /利弊?更好的方法來做到這一點?
使用此方法:使用所需的表創建數據庫,其中與所有用戶有關的數據將通過適當索引表中的列進行存儲。
根據用戶標識爲特定用戶創建mysql'視圖'。
爲了實現行級別的安全性,我還必須爲每個用戶創建一個mysql帳戶,併爲這些視圖設置「grant」權限。
對於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.
而不是嘲笑我,你能建議我能做什麼/讀嗎? – ThinkingMonkey
這不是在嘲笑你,但我很抱歉,如果它看起來像那樣。我只是想知道爲什麼你甚至試圖這樣做。爲什麼你甚至需要「行級安全性」,這樣做的理由是什麼,以及通過這樣做有什麼預防?至於磁盤I/O,創建用戶,視圖等並不會影響磁盤I/O,因此您不必擔心這一點(除非每天都有成千上萬的新用戶,這會累加到磁盤I上/ O處理視圖時)。 –
我需要'行級安全性',因爲有多行將被多個用戶共享,並有1或2個所有者。只有這些所有者才能刪除/修改它們。 ***如果你知道我可以在哪裏瞭解更好的方法,那麼建議他們。*** – ThinkingMonkey