I'm looking for some idea(-s) how can I solve such task in Symfony3 or generally in symfony.
Let say, that I allow the user to create some content on the page (i.e post or article). The thing is that part of this content can be restricted on demand by the user. So for example user is creating Article1 and Article2 and he specified that Article2 will be protected by some defined password/token by himself . If someone anonymous will try to reach via url Article1, he will be able to see the content, but when someone will use the Url of Article2 some kind of formular will popup with the hint "Put the password to access this specific area" or similar.
Is there any way to solve that in the symfony 3 way?
Right now I would solve this in such way, that in the controller (i.e showArticleAction) I will check if the requested Article is protected or not. If not the normal way will be used (render of templete etc), but if the section is protected I would redirect the user to some additional "login controler" where he could put the password only for this specific content. In case the password match he will be redirected to the protected article.
I don't want to use acl or similar as each content can have his own protection and with acl I would be forced to create dynamically groups for each protected article, because user that has access to Article 2 cannot access another protected article as it can have completely another protection via password/token and also be created by different user
As I mentioned I strongly want to do it follow the "symfony3" rules, without any tricks from my or any side :)
I'm glad to read your ideas and hints.
Best regards, Konrad