public function aco($acoId)
    {
        $this->loadModel('User.Acos');
        $aco = $this->Acos->get($acoId, ['contain' => ['Roles']]);
        $path = $this->Acos->find('path', ['for' => $acoId])->extract('alias')->toArray();

        if (!empty($this->request->data['roles'])) {
            $aco = $this->Acos->patchEntity($aco, $this->request->data);
            $save = $this->Acos->save($aco);

            if (!$this->request->isAjax()) {
                if ($save) {
                    $this->Flash->success(__d('user', 'Permissions were successfully saved!'));
                } else {
                    $this->Flash->danger(__d('user', 'Permissions could not be saved'));
                }
            }
        }

        $roles = $this->Acos->Roles
            ->find('list')
            ->where(['Roles.id <>' => ROLE_ID_ADMINISTRATOR]);
        $this->title(__d('user', 'Permissions'));
        $this->set(compact('aco', 'roles', 'path'));
    }
public function aco($acoId)
    {
        $this->loadModel('User.Acos');
        $aco = $this->Acos->get($acoId, ['contain' => ['Roles']]);
        $path = $this->Acos->find('path', ['for' => $acoId])->extract('alias')->toArray();

        if (!empty($this->request->data['roles'])) {
            $aco = $this->Acos->patchEntity($aco, $this->request->data);
            $save = $this->Acos->save($aco);

            if (!$this->request->isAjax()) {
                if ($save) {
                    $this->Flash->success(__d('user', 'Permissions were successfully saved!'));
                } else {
                    $this->Flash->danger(__d('user', 'Permissions could not be saved'));
                }
            }
        }

        $roles = $this->Acos->Roles
            ->find('list')
            ->where(['Roles.id <>' => ROLE_ID_ADMINISTRATOR]);
        $this->title(__d('user', 'Permissions'));
        $this->set(compact('aco', 'roles', 'path'));
    }
public function aco ( $ acoId ) { $ this -> loadModel ( 'User.Acos' ) ; $ aco = $ this -> Acos -> get ( $ acoId , [ 'contain' => [ 'Roles' ] ] ) ; $ path = $ this -> Acos -> find ( 'path' , [ 'for' => $ acoId ] ) -> extract ( 'alias' ) -> toArray ( ) ; if ( ! empty ( $ this -> request -> data [ 'roles' ] ) ) { $ aco = $ this -> Acos -> patchEntity ( $ aco , $ this -> request -> data ) ; $ save = $ this -> Acos -> save ( $ aco ) ; if ( ! $ this -> request -> isAjax ( ) ) { if ( $ save ) { $ this -> Flash -> success ( __d ( 'user' , 'Permissions were successfully saved!' ) ) ; } else { $ this -> Flash -> danger ( __d ( 'user' , 'Permissions could not be saved' ) ) ; } } } $ roles = $ this -> Acos -> Roles -> find ( 'list' ) -> where ( [ 'Roles.id <>' => ROLE_ID_ADMINISTRATOR ] ) ; $ this -> title ( __d ( 'user' , 'Permissions' ) ) ; $ this -> set ( compact ( 'aco' , 'roles' , 'path' ) ) ; }
Shows the permissions table for the given ACO.

@param int $acoId ACO's ID
@return void
Shows the permissions table for the given ACO .