How to limit data to users who own it without limiting admin users in CakePHP?

后端 未结 3 960
太阳男子
太阳男子 2020-12-18 09:17

Currently I am writing an application where I have multiple users. They have data that should only be visible to them and not the other authenticated users in the system. I

3条回答
  •  抹茶落季
    2020-12-18 09:47

    You can get the current user info this way: $this->Auth->user(). You can use the user group id in your callback to limit the query. Also take a loot at WhoDidIt Behavior.

提交回复
热议问题