protected function _rolePermissions($roleId)
    {
        $Acos = TableRegistry::get('User.Acos');
        $Permissions = TableRegistry::get('User.Permissions');
        $out = [];
        $acoIds = $Permissions
            ->find()
            ->select(['aco_id'])
            ->where(['role_id' => $roleId])
            ->all()
            ->extract('aco_id')
            ->toArray();

        foreach ($acoIds as $acoId) {
            $path = $Acos->find('path', ['for' => $acoId]);

            if (!$path) {
                continue;
            }

            $path = implode('/', $path->extract('alias')->toArray());
            if ($path) {
                $out[$path] = true;
            }
        }

        return $out;
    }
protected function _rolePermissions($roleId)
    {
        $Acos = TableRegistry::get('User.Acos');
        $Permissions = TableRegistry::get('User.Permissions');
        $out = [];
        $acoIds = $Permissions
            ->find()
            ->select(['aco_id'])
            ->where(['role_id' => $roleId])
            ->all()
            ->extract('aco_id')
            ->toArray();

        foreach ($acoIds as $acoId) {
            $path = $Acos->find('path', ['for' => $acoId]);

            if (!$path) {
                continue;
            }

            $path = implode('/', $path->extract('alias')->toArray());
            if ($path) {
                $out[$path] = true;
            }
        }

        return $out;
    }
protected function _rolePermissions ( $ roleId ) { $ Acos = TableRegistry :: get ( 'User.Acos' ) ; $ Permissions = TableRegistry :: get ( 'User.Permissions' ) ; $ out = [ ] ; $ acoIds = $ Permissions -> find ( ) -> select ( [ 'aco_id' ] ) -> where ( [ 'role_id' => $ roleId ] ) -> all ( ) -> extract ( 'aco_id' ) -> toArray ( ) ; foreach ( $ acoIds as $ acoId ) { $ path = $ Acos -> find ( 'path' , [ 'for' => $ acoId ] ) ; if ( ! $ path ) { continue ; } $ path = implode ( '/' , $ path -> extract ( 'alias' ) -> toArray ( ) ) ; if ( $ path ) { $ out [ $ path ] = true ; } } return $ out ; }
Gets all permissions available for the given role.

Example Output:

```php
[
'User/Admin/Gateway/login' => true,
'User/Admin/Gateway/logout' => true,
...
]
```

Resulting array is always `key` => **true**, as role have access to every ACO
in the array "true" is the only possible value.

@param int $roleId Role's ID
@return array Array of ACO paths which role has permissions to
Gets all permissions available for the given role .