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

  • Home
  • SEARCH
  • 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 783587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:34:17+00:00 2026-05-14T20:34:17+00:00

I’m building a controller to manage group based ACL in CakePHP and when I

  • 0

I’m building a controller to manage group based ACL in CakePHP and when I create or edit a group I want to be able to select what permissions it has. The group data table only stores a group ID and a group Name as the permissions are stored in the ACO/ARO table.

I have an array from the ACO that I want to turn into a set of checkboxes so you can check them to allow access from that group to that ACO. So first off, how do I turn this array into a set of checkboxes. The array looks like this:

array(
    [0] => array(
        [Aco] => array(
            [alias] => 'alias'
            [id] => 1)
        [children] => array (
            [0] => array(
                [Aco]=>
            ...etc  
    ))
    [1] => array(
        ...etc
)

My next question is how can I check these once the form has been submitted to the controller to allow the selected actions?

[Update]
Ok changing the angle of my question, how can I use the Form helper to create forms that are not based on any Model?

  • 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-14T20:34:17+00:00Added an answer on May 14, 2026 at 8:34 pm

    You may want to check PoundCake Control Panel (for CakePHP 1.2) – take a look at the screenshots. The functionality you want is present there but radio inputs are used instead of checkboxes. Users and Groups are linked to ACOs. So, changing Users or Groups tree structure you change the tree structure of ACOs. Menu items are linked to AROs. So, changing the tree structure of menus you change the tree structure of AROs.

    For example, in groups_controller.php:

    public function permissions($id = null){
        $this->_checkIdPresence($id);
        if(!empty($this->data)){
            $aroNode = array('model' => 'Group', 'foreign_key' => $this->data['Group']['id']);
            foreach($this->data['Acos'] as $aco){
                if(!empty($aco['permission'])){
                    $do = '';
                    if($aco['permission'] == '1'){
                        $do = 'allow';
                    }elseif($aco['permission'] == '-1'){
                        $do = 'deny';
                    }
                    $acoNode = array('model' => $aco['model'], 'foreign_key' => $aco['foreign_key']);
                    if($this->Acl->{$do}($aroNode, $acoNode, '*')){
                        $message = sprintf(__('<i>%s</i> permission to <i>%s</i> has been saved.', true),ucfirst($do), $aco['name']);
                        $this->_flash($message, 'success');
                    }else{
                        $message = sprintf(
                            __('<i>%s</i> permission to <i>%s</i> could not be saved. Please, try again.', true),
                            ucfirst($do), $aco['name']
                        );
                        $this->_flash($message, 'error');
                    }
                }
            }
        }
        // Get ARO for the current Group and all related ACOs from the db
        $this->data = $this->Group->read(null, $id);
        $acosTree = $this->ControlPanel->checkPermissions($id);
        $existingPermissions = $this->ControlPanel->findRecordedPermissions($id);
        $this->set(compact('acosTree', 'existingPermissions'));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 391k
  • Answers 391k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You're using ASM blocks, not intrinsic. Since those xmmX are… May 15, 2026 at 1:24 am
  • Editorial Team
    Editorial Team added an answer I do not do it - CLR ins SQL Server… May 15, 2026 at 1:24 am
  • Editorial Team
    Editorial Team added an answer This code does work as expected, but the titles are… May 15, 2026 at 1:24 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.