# |
Jun 18th 2019, 20:19 |
devito |
the acl plugin for 3.x is pretty solid |
# |
Jun 18th 2019, 20:19 |
challgren |
@devito you can’t unless you do it on the browser side via javascript |
# |
Jun 18th 2019, 20:19 |
devito |
@ricksaccous yeah thats what acl’s are |
# |
Jun 18th 2019, 20:18 |
devito |
beforeRedirect? |
# |
Jun 18th 2019, 20:18 |
devito |
which callback in the controller life cycle should I use to detect when a user is leaving a page? |
# |
Jun 18th 2019, 20:02 |
ricksaccous |
hmmmm |
# |
Jun 18th 2019, 19:42 |
ricksaccous |
I'm guessing this is what ACLs are? |
# |
Jun 18th 2019, 19:42 |
ricksaccous |
as a serialized array |
# |
Jun 18th 2019, 19:42 |
ricksaccous |
i'm thinking of storing the url params that i want a permission to handle in the table |
# |
Jun 18th 2019, 19:42 |
ricksaccous |
would it be better to seed a user permissions table |
# |
Jun 18th 2019, 19:41 |
ricksaccous |
so i want users -> user roles -> user permissions |
# |
Jun 18th 2019, 19:41 |
ricksaccous |
right now I have a permissions array and I plan on just saving a version of that array as a hasMany to each role i create |
# |
Jun 18th 2019, 19:41 |
ricksaccous |
authorize/authenticate |
# |
Jun 18th 2019, 19:40 |
ricksaccous |
and used it with the new plugins? |
# |
Jun 18th 2019, 19:40 |
ricksaccous |
anyone ever built a permissions system? |
# |
Jun 18th 2019, 19:05 |
hollistergraham123 |
I am using this code but when it goes to marshall it is marshaling the active_store_inventory record of item as a new entity even though it has an id. Any thoughts |
# |
Jun 18th 2019, 19:05 |
hollistergraham123 |
$associations = [ ‘Procedures’, ‘Items’ => [‘associated’ => ‘ActiveStoreInventories’], ];$maintenance = $this->Maintenances->patchEntity($maintenance, $data, [‘associated’ => $associations] ); |
# |
Jun 18th 2019, 16:27 |
daniel.upshaw |
You can put that anywhere in your controller method and not have to return it |
# |
Jun 18th 2019, 16:26 |
daniel.upshaw |
@neon1024 Another way might be `$this->autoRender = false` ... Not sure which way is preferred |
# |
Jun 18th 2019, 16:24 |
neon1024 |
Sorted it with `return $this->render(false)` |
# |
Jun 18th 2019, 16:20 |
neon1024 |
I am hitting an api endpoint with a `.json` extension and Accept application/json headers, but I’m getting a missing template error back. What am I missing? |
# |
Jun 18th 2019, 16:02 |
daniel.upshaw |
It will use my templates, but usually have a super hard time getting it to use the Controller |
# |
Jun 18th 2019, 16:02 |
daniel.upshaw |
I always seem to have trouble getting a custom bake theme to use my custom ControllerTask.php, which extends \Bake\Shell\Task\ControllerTask |
# |
Jun 18th 2019, 15:20 |
scriptstupid |
For some reason I had to rename it from $image->path to $image->directory and it worked. Guessing it's a protected keyword even when applied to any entity or something |
# |
Jun 18th 2019, 15:14 |
chris-andre |
@scriptstupid Your question misses some information, and some code as well. Looks like cakephp 3.x? Check your Model\Entity, if field is accessible. Only thing I can come up with. |
# |
Jun 18th 2019, 14:42 |
scriptstupid |
I'm very simply trying to assign a value to an entity and it's not taking... $image->path is blank no matter what I do (see https://pastebin.com/ejmsnNac) |
# |
Jun 18th 2019, 14:10 |
ricksaccous |
@admad thanks as well |
# |
Jun 18th 2019, 14:10 |
ricksaccous |
I think i'll just forego the helper for now since it's easy enough for me to set the user entity in a beforeFilter that gets loaded in a component that all my controllers will use |
# |
Jun 18th 2019, 14:09 |
ricksaccous |
no yeah you're right @jeremyharris thank you |
# |
Jun 18th 2019, 14:07 |
ricksaccous |
let me see if that was the problem all along |
# |
Jun 18th 2019, 14:07 |
ricksaccous |
basically i had my entity implementing identityInterface but just left the methods blank |
# |
Jun 18th 2019, 14:07 |
ricksaccous |
cool |
# |
Jun 18th 2019, 14:07 |
ricksaccous |
getOriginalData just works |
# |
Jun 18th 2019, 14:07 |
ricksaccous |
oh when i take my own implementation out |
# |
Jun 18th 2019, 14:05 |
ricksaccous |
hehe |
# |
Jun 18th 2019, 14:05 |
ricksaccous |
i realize i have getOriginalData in my entity but never implemented it |
# |
Jun 18th 2019, 14:05 |
ricksaccous |
i see i see |
# |
Jun 18th 2019, 14:05 |
jeremyharris |
so using a custom identity class would solve the problem |
# |
Jun 18th 2019, 14:04 |
jeremyharris |
I think it’s related to this: https://github.com/cakephp/authentication/issues/260 |
# |
Jun 18th 2019, 14:04 |
admad |
IDK, never used the plugin. I just checked the methods the identitydecorator class provides :slightly_smiling_face: |
# |
Jun 18th 2019, 14:04 |
jeremyharris |
I haven’t used the helper, just looking at the code atm |