简体   繁体   中英

Symfony2: ACL permit access to routes with keys

I have some CRUD routing:

/news/{page} // public
/news/new    // private
/news/{slug}/show  //public
/news/{slug}/edit  //private
/news/{slug}/delete  //private

What placeholder do I have to set at access_controll in security.yml?

Regards

您可以使用.+例如

    - { path: ^/news/.+/show, role: IS_AUTHENTICATED_ANONYMOUSLY }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM