how to find out my current user id in other page controller after i login?

后端 未结 5 546
离开以前
离开以前 2021-02-06 12:30

i am planing to set a permission on my event index page, which just allow certain user to view which had set when i add the event. After user click into my event, the event cont

5条回答
  •  抹茶落季
    2021-02-06 12:49

    Also, for a simple approach, have a look at the model and controller settings of AuthComponent::authorize. This allows you to define an isAuthorized() method in your controller or model (your choice) which will store logic that determines access (should return true if access allowed and false if denied).

提交回复
热议问题