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 9224879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:26:16+00:00 2026-06-18T04:26:16+00:00

I have the following situation: multiple views use a content editor that can upload

  • 0

I have the following situation: multiple views use a content editor that can upload files and retrieve a list of previous uploads via AJAX. I end up adding two actions to every controller for this. Instead, I want to have just one common single-purpose EditorController that handles the editor interactions for me.

The problem with this is access rights: I want the EditorController to check whether a request is coming from a valid source (that means a known action the current user has access to). In concrete terms, check that the request is coming from something like ‘/posts/edit/1’ and that this is an action I am allowed to use.

Can this be done? What is a better way to achieve the same result? I currently have the functionality already packaged into a component I reuse. But I still repeat myself adding the same two actions to all my controllers.

Edit: From the comment below I was pointed to http://book.cakephp.org/2.0/en/core-libraries/components/security-component.html#restricting-cross-controller-communication. The thing I want to achieve is very similar to SecurityComponent::$allowedControllers and SecurityComponent::$allowedActions, except that I would rather not explicitly whitelist the allowed controllers or actions, but rather have the access right inherited from the caller.

  • 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-06-18T04:26:17+00:00Added an answer on June 18, 2026 at 4:26 am

    Using the Security component might give you what you want;

    http://book.cakephp.org/2.0/en/core-libraries/components/security-component.html

    [update]
    Although the security component checks if a form posted was a valid form, it does not check if the current user has permissions to access a controller/action.

    For this you’ll need to implement an authorisation system, in combination with access control. This can be a simple ‘access’ controll for certain actions (“is a user logged in?”), or a more granular aproach using access control lists (ACL).

    The cakephp manual has some examples for both. I’ll post some links:

    Authentication
    http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html

    Access Control Lists
    http://book.cakephp.org/2.0/en/core-libraries/components/access-control-lists.html

    And a tutorial on both
    http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html
    http://book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-controlled-application/simple-acl-controlled-application.html

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

Sidebar

Related Questions

Consider the following situation: I have an object foo that is used by multiple
I have the following situation: A project can belong to multiple departments, Employees are
I have the following situation: <input id=upload_trigger_btn type=file name=files[] multiple> <a type=submit class=button-normal-12px-ffffff href=#><span>Add
I have the following situation: multiple virtual directories under same application pool in IIS
I have the following situation: An Conversations entity/table which has multiple Tags associated to
I have the following situation. I have a database of transactions about multiple contracts.
I have the following situation: There is a windows folder that has been mounted
quick and probably dumb question. I have the following situation: I select multiple elements
I have the following situation: On[t::shdw] Message[t::shdw,t,Foobar,Dork] -> t::shdw: Symbol t appears in multiple
It is the following situation: I currently have multiple Java projects in Eclipse. All

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.