Log message #4192960

# At Username Text
# Jul 12th 2019, 11:46 noel Also I don't understand why we would want an ApiController – since the actions are controlled by the Devices controller. I would have expected that the routing should direct to this controller for the `/api/devices/` route.
# Jul 12th 2019, 11:46 igreat At the time of making the tutorial, I think middleware has not implemented the it is now, hence that part was not included
# Jul 12th 2019, 11:43 igreat Let me see
# Jul 12th 2019, 11:42 igreat Ok
# Jul 12th 2019, 11:34 noel @igreat no I don't have an ApiController. I'm following this tutorial: http://www.bravo-kernel.com/2015/04/how-to-build-a-cakephp-3-rest-api-in-minutes/ but it doesn't seem to work – they don't mention CORS issues, nor do they mention adding an `api` route nor ApiController.
# Jul 12th 2019, 11:33 igreat @noel but you have ApiController?
# Jul 12th 2019, 11:32 igreat You should see that somewhere around line 50 and 58 of your routes.php file
# Jul 12th 2019, 11:28 noel @igreat oh. Ok but when I do that it says: "ApiController could not be found"
# Jul 12th 2019, 11:27 igreat Oooh, so not to use the CSRF middleware which is registered and applied in the `Router::scope('/', function (RouteBuilder $routes)`
# Jul 12th 2019, 11:25 noel @igreat which I would want to do because... ?
# Jul 12th 2019, 11:25 igreat In your routes.php file you can make a diff `Router::scope()` function outside the `Router::scope('/', function (RouteBuilder $routes)`
# Jul 12th 2019, 11:20 noel @igreat umm.. not sure what to do with the snippet you've shown.
# Jul 12th 2019, 11:17 igreat @noel Ok, I need to do it with 3.7
# Jul 12th 2019, 11:15 slackebot <igreat>
# Jul 12th 2019, 11:13 noel @igreat although that was back in 2.x, so maybe it has changed. There was `./Console/cake AclExtras.AclExtras aco_sync`
# Jul 12th 2019, 11:11 noel @igreat I've done ACL before (quite a while ago). There's some CLI stuff to help you manage it iirc
# Jul 12th 2019, 11:10 noel @igreat disabling CSRF as per those links doesn't seem to help. I assume that snippet is for the controller? (You said routes).
# Jul 12th 2019, 11:10 igreat Guys I want to create an ACL in project using the Authorization and Authentication plugins, any headway on how to go about it?
# Jul 12th 2019, 11:06 neon1024 As you know the expected outcome
# Jul 12th 2019, 11:06 neon1024 I would probably start with TDD
# Jul 12th 2019, 11:05 half2me anyway, maybe I’ll just try to write some simple logic
# Jul 12th 2019, 11:05 half2me but I would need it to just cover basic hasOne and hasMany cases
# Jul 12th 2019, 11:05 half2me I know with complex scenarios it can get out of hand
# Jul 12th 2019, 11:05 half2me and it would take care of updating them
# Jul 12th 2019, 11:05 neon1024 I didn’t bother in the end, it was too complicated
# Jul 12th 2019, 11:04 half2me yeah, I was thinking of just a simple merger, where you could tell it what associations to look at
# Jul 12th 2019, 11:04 neon1024 With nested recursive functions and all sorts
# Jul 12th 2019, 11:04 half2me lol
# Jul 12th 2019, 11:04 neon1024 Last time I tried to write an entity merger it got well out of hand
# Jul 12th 2019, 11:04 neon1024 Ah well, that’s how I’d do it anyway
# Jul 12th 2019, 11:04 neon1024 You could duplicate the existing one, which will perserve the keys, change the author id and you’re done
# Jul 12th 2019, 11:04 half2me I want to merge 1 entity into another
# Jul 12th 2019, 11:03 half2me but I don’t want to create anything new
# Jul 12th 2019, 11:03 half2me for duplicating entities
# Jul 12th 2019, 11:03 neon1024 You’re creating something new
# Jul 12th 2019, 11:03 neon1024 No, I don’t think so
# Jul 12th 2019, 11:03 half2me I’ve used this behavior before
# Jul 12th 2019, 11:03 half2me @neon1024 isn’t this the exact opposite? :)
# Jul 12th 2019, 11:03 neon1024 As the set option allows you to change the resulting entity
# Jul 12th 2019, 11:03 half2me so merging Author 2 into Author 1 needs to update everyone’s `author_id` associated to Author 2.
# Jul 12th 2019, 11:03 neon1024 https://github.com/riesenia/cakephp-duplicatable