Log message #4017561

# At Username Text
# Apr 19th 2017, 12:07 inoas maybe you need something like this $this->_userModel = 'FlexiSystem.Users'; // Muffin/Footprint .. .if you users live ina plugin
# Apr 19th 2017, 12:07 hmic all that crap goes away with middlewares, finally
# Apr 19th 2017, 12:07 Junior allow me 2 minutes to paste
# Apr 19th 2017, 12:07 Junior inoas, yes , i have that
# Apr 19th 2017, 12:06 inoas in my case
# Apr 19th 2017, 12:06 inoas and well $this->addBehavior('Muffin/Footprint.Footprint', ['events' => ['Model.beforeSave' => ['user_id' => 'always']]]);
# Apr 19th 2017, 12:06 hmic obinoob, if you have a baked controller, just use the view function but pass the Auth->user('id') instead of $id.
# Apr 19th 2017, 12:06 inoas https://gist.github.com/inoas/6152e91774ef3f303b6f4b567d726b19
# Apr 19th 2017, 12:06 inoas Junior: straight from my project
# Apr 19th 2017, 12:05 obinoob ionas thank you
# Apr 19th 2017, 12:05 Junior inside appController
# Apr 19th 2017, 12:05 inoas muffin can do that for you (I think)
# Apr 19th 2017, 12:05 Junior and use FootprintAwareTrait;
# Apr 19th 2017, 12:05 inoas basically all you pass down is the user id
# Apr 19th 2017, 12:05 Junior inoas i have added use Muffin\Footprint\Auth\FootprintAwareTrait; //https://github.com/UseMuffin/Footprint
# Apr 19th 2017, 12:04 inoas obinoob: yeah
# Apr 19th 2017, 12:03 Junior inoas, i had foreign keys, i had to drop them to see what happens :)
# Apr 19th 2017, 12:02 obinoob ionas the finder would go in UserTable class I guess
# Apr 19th 2017, 12:00 obinoob ionas that sound nice
# Apr 19th 2017, 11:59 inoas you can build a finder that is only for the user himself, and pass down the user id from auth component when calling it from your controller
# Apr 19th 2017, 11:58 inoas ;p
# Apr 19th 2017, 11:58 inoas middleware... urgh
# Apr 19th 2017, 11:58 inoas the check for what he can do can either be controller or model domain
# Apr 19th 2017, 11:58 inoas obinoob: IMHO depends. The check for which user is operating clearly is controller space
# Apr 19th 2017, 11:57 inoas add debug() on top of $this->addBehavior
# Apr 19th 2017, 11:56 inoas and you have to make sure your model where you use addBehavior is actually being used
# Apr 19th 2017, 11:56 inoas then this line is important use Muffin\Footprint\Auth\FootprintAwareTrait;
# Apr 19th 2017, 11:56 hmic can be a middleware very well as of 3.4 :D
# Apr 19th 2017, 11:56 inoas Junior: first of all setup foreign keys so that user_id cannot ever be 0 or NULL ;) - just in case muffin does not work you do not accidentially save data without user ids :p
# Apr 19th 2017, 11:56 hmic "code that would allow" - thats authorization
# Apr 19th 2017, 11:49 obinoob I have a small doubt about where should i put code that allows a user to view only his own data entries I suppose that kind of logic would go in model instead of controller?
# Apr 19th 2017, 11:39 Junior my createdby is saved as 0 instead of the actual user id
# Apr 19th 2017, 11:29 Junior i am using https://github.com/UseMuffin/Footprint and my user is not loaded, i have followed the docs, any ideeas why?
# Apr 19th 2017, 11:13 inoas _setIsPublished right
# Apr 19th 2017, 11:12 inoas in which mutator/accessor would that happen?
# Apr 19th 2017, 11:11 inoas to save the state along
# Apr 19th 2017, 11:11 inoas i want to set was_published to 1 in my entity
# Apr 19th 2017, 11:11 inoas when is_published is set to 1
# Apr 19th 2017, 10:58 hmic that poor cobra-the-joker... 1.2 :DD
# Apr 19th 2017, 10:54 hmic no, thats worong too :/
# Apr 19th 2017, 10:54 hmic so add after line 26 'order' => ['Users.name' => 'asc'] instead of line 31