I want to create a simple blog example where users have a favourite category attached to there account. This means the can only write articles for this category. (Some of th
You can get user object from Security Context
Security Context
$user = $serviceContainer->get('security.context')->getToken()->getUser();
Small tip: In case if user is not logged in - you'll have string in $user, otherwise - User object.
$user
Cheers ;)