Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6205723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:19:29+00:00 2026-05-24T05:19:29+00:00

I was looking at the Documents for sfGuard and Symfony about the security. But

  • 0

I was looking at the Documents for sfGuard and Symfony about the security. But I cannot find anywhere about secure a whole Controller. There is only called action Secure.

I tried to use the preExecute method to make a call to forward404Unless($this->getUser()->hasGroup('admin')) but it doesn’t work.

Is it possible to use the security.yml and sfGuard to secure my actions in a controller? Or is there practice of doing this in symfony? It will be a hassle to edit every single controller I have had to create custom security that might change in the future.

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:19:30+00:00Added an answer on May 24, 2026 at 5:19 am

    Well symfony use a cascading configuration schema, those allowing you to configure all your project/app/module/action in a more reusable and practical way. With security happens the same thing, you can use the security.yml to define access restrictions.

    If you create a security.yml in the app folder (that would be $sf_root/app_name/config/security.yml) and specify something like this:

    default:
      is_secure:true
    

    It will make all your app secure by default (users will have to be logged in), allowing you to overwrite when appropiate. Lets say the file module has an action “download” that needs admnistrator credentials, but all the other actions could be used by user having “common” and “administrator” credentials, so you will have to create a security.yml at $sf_root/apps/app_name/modules/file/config/ and define:

    all:
      credentials: [[ common , administrator]]
    
    download:
      credentials: [ administrator ]
    

    For more info on security and advanced credentials, please check out symfony page on Action Security

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was looking for uploading photos by email documents (in php) but couldn't find
I've been looking for this information through Apple documents, but could not find the
How secure are XPS documents? After looking from the inside of an XPS document,
I'm looking through several documents but for some reason I can't wrap my head
I'm looking for some advice about saving OpenXML documents, specifically a PresentationDocument. In my
I am looking to develop/locate a find-replace tool for XPS documents. Does anyone know
Are there any existing solutions to create documents in Silverlight? Looking to create purchase
I'm after a tool to generate decent-looking documents from templates, that needs to: be
Looking to see what others do with 3rd party (vendor) java documents? Do they
We are looking into silent printing of PDF documents from within Java. The printing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.