# |
Jul 12th 2019, 15:19 |
ndm |
Baking should work... like `bake policy --type=table Users` |
# |
Jul 12th 2019, 15:15 |
waspinator |
I had to manually create a `UsersTablePolicy.php` to get things to work |
# |
Jul 12th 2019, 15:12 |
ricksaccous |
it doesn't seem to be helping me |
# |
Jul 12th 2019, 15:12 |
ricksaccous |
maybe i should ditch resource routing for this route |
# |
Jul 12th 2019, 15:12 |
waspinator |
oh I see. I don't think bake supports tables yet |
# |
Jul 12th 2019, 15:10 |
ndm |
@waspinator Depends on your resolver (configuration) https://book.cakephp.org/authorization/1.1/en/policy-resolvers.html |
# |
Jul 12th 2019, 15:07 |
ricksaccous |
An Internal Error Has Occurred Error: A route matching "/api/hospitals/hospital_service_rates/edit/20/3/0.json" could not be found. |
# |
Jul 12th 2019, 15:06 |
ricksaccous |
matching the current url |
# |
Jul 12th 2019, 15:06 |
ricksaccous |
on the page i'm echoing the form it's not a problem, but when i actually ajax post to that url when i hit the url it is saying route not found |
# |
Jul 12th 2019, 15:06 |
slackebot |
<ricksaccous> |
# |
Jul 12th 2019, 15:04 |
ricksaccous |
especially since it was working a few seconds ago :( |
# |
Jul 12th 2019, 15:03 |
ricksaccous |
i'm having another routes issue now though, and route issues are my least favorite |
# |
Jul 12th 2019, 15:02 |
ricksaccous |
meh |
# |
Jul 12th 2019, 15:02 |
ricksaccous |
probably |
# |
Jul 12th 2019, 15:02 |
ricksaccous |
honestly i'd just not use unauthorizedredirect and put the redirects in the log in method itself |
# |
Jul 12th 2019, 15:01 |
neon1024 |
Could be! |
# |
Jul 12th 2019, 15:01 |
neon1024 |
@ndm Redirect before login? :thinking_face: |
# |
Jul 12th 2019, 15:01 |
ricksaccous |
cheers m8 |
# |
Jul 12th 2019, 15:01 |
neon1024 |
One for Monday! Have a super weekend everyone |
# |
Jul 12th 2019, 15:01 |
ndm |
Probably because the redirect happens before your method/action is being invoked... |
# |
Jul 12th 2019, 14:58 |
neon1024 |
Why can’t I use `$this->Auth->setConfig('unauthorizedRedirect', ['prefix' => false, 'controller' => 'Dashboards', 'action' => 'home']);` in my login method to set the redirect per role? |
# |
Jul 12th 2019, 14:50 |
waspinator |
I've tried both and `"Policy for `App\\Model\\Table\\UsersTable` has not been defined.` |
# |
Jul 12th 2019, 14:49 |
waspinator |
What is the naming convention for policy files? Do you use plural or single? |
# |
Jul 12th 2019, 14:05 |
ricksaccous |
good luck |
# |
Jul 12th 2019, 14:04 |
jeremy.payne |
Trying to avoid that mess with the port :) |
# |
Jul 12th 2019, 14:03 |
jeremy.payne |
In the cake2 app they have all the multi-tenant code in folders and a symbolic link and a weird custom autoloader to force it to look into the symlink |
# |
Jul 12th 2019, 14:03 |
jeremy.payne |
But yeah, definitively an interesting setup and complicated code base that has suffered from feature bloat from people who didn't have much experience in engineering big apps. |
# |
Jul 12th 2019, 14:01 |
ricksaccous |
hehe |
# |
Jul 12th 2019, 14:01 |
ricksaccous |
oh, maybe that isn't so bad after all i suppose |
# |
Jul 12th 2019, 14:01 |
jeremy.payne |
I've been hired to port a cake2 to cake3 with no experience in either so it's a fun trying to fix weird architecture choices done :slightly_smiling_face: |
# |
Jul 12th 2019, 14:01 |
ricksaccous |
so each country has their own db? |
# |
Jul 12th 2019, 14:00 |
ricksaccous |
wow, sounds like a tricky set up nonetheless |
# |
Jul 12th 2019, 13:59 |
jeremy.payne |
There are BaseComponents and the tenant code just extends some bits and pieces |
# |
Jul 12th 2019, 13:59 |
jeremy.payne |
No we have one code base for a website running for several countries, where each country is run on a separate server |
# |
Jul 12th 2019, 13:59 |
neon1024 |
A component per tenant does seem odd to me, feels like there will lots of repeated code |
# |
Jul 12th 2019, 13:58 |
ricksaccous |
@jeremy.payne are you doing a multi-site set up with subdomains? just curious |
# |
Jul 12th 2019, 13:56 |
neon1024 |
Then you can bind it once globally, and then attach the components where you need them in one neat place |
# |
Jul 12th 2019, 13:55 |
neon1024 |
@jeremy.payne I’d look at using a listener |
# |
Jul 12th 2019, 13:54 |
ricksaccous |
$this->getController->loadComponent(); |
# |
Jul 12th 2019, 13:54 |
ricksaccous |
i just load them in the initialize of the main component they all load |
# |
Jul 12th 2019, 13:51 |
jeremy.payne |
Yeah that's basically what I'm doing with my `Tenant` facade |