Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3925

@IsGranted annotation on property of subject

$
0
0

I have annotation (working)

@IsGranted("editBlog", subject="company")

but I want something like this (not working):

@IsGranted("edit", subject="company.blog")

"Company" and "Blog" are Doctrine Entities with OneToOne relation. But my action have only "company" parameter.

    /**
     * @IsGranted("editBlog", subject="company")
     * @param CompanyEntity $company
       ...
     * @return Response
     */
    final public function defaultAction(
        CompanyEntity $company,
        ...
    )
    {
     ...
    }

How to access a variable in a subject?

Thanks!


Viewing all articles
Browse latest Browse all 3925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>