Mar

23

In Cook up Web sites fast with CakePHP, Part 2: Bake bigger and better with CakePHP by IBM, you may have problems working with Access Control Lists (ACL).

In your app directory the tutorial states within the terminal define your groups with the following code.

php acl.php create aro 0 null Users
php acl.php create aro 0 null Dealers

When you do this you will get the following response:

Could not open input file: acl.php

Now instead of using

php acl.php create aro 0 null Users
php acl.php create aro 0 null Dealers

try the following code:

../cake/console/cake acl create aro root 'Users'
../cake/console/cake acl create aro root 'Dealers'

now you may get an error message similar to the one below:

Fatal error: Class 'String' not found in /mycakelocation/cake/libs/model/datasources/dbo_source.php on line 1455


Now open the dbo_source.php, on line 29, replace

uses('set');

with

uses('set', 'string');

save the file and run the following lines of code again:

../cake/console/cake acl create aro root 'Users'
../cake/console/cake acl create aro root 'Dealers'

Now you are done!



Similar Posts

Comments

Name (required)

Email (required)

Website

Speak your mind

7 Comments so far

  1. Beeta on March 24, 2008 12:06 am

    the first problem was made by the author of the IBM tutorial, the second problem is from CakePHP, but I thought a nightly build version of CakePHP fixed the bug already?

  2. Sarah Lewis on April 3, 2008 12:10 pm

    Thanks so much for organizing this info and publishing in one place. :) It’s handy for those of us who don’t want to upgrade to the nightly but still need to work with ACL.

  3. admin on April 28, 2008 9:24 am

    You are welcome! I am glad it helps!

  4. Cássio on May 14, 2008 7:01 am

    Hello i’m from Brazil, sorry my inghish

    follow their guidelines, but the error persists.

    I run code:

    C:\www\cake\ibmblog\app>cake acl create aro root ‘Users’

    Welcome to CakePHP v1.2.0.6311 beta Console
    —————————————————————

    Fatal error: Class ‘String’ not found in C:\www\cake\cake12\cake\libs\model\datasources\dbo_source.php on line 1455

    Can you help me?

  5. admin on May 14, 2008 9:36 am

    Hi, Cássio

    Just find the file cake/libs/model/datasources/dbo_source.php, open it, find the code uses(’set’); and change it to uses(’set’, ’string’);

    It should work. :)

  6. liviu on May 31, 2008 8:55 am

    Thx for this post.
    And i think the command should be
    ../cake/console/cake acl create aro root Users
    otherwise the response message is
    New Aro ”Users” created.
    Not 100% sure thou, I’m new to cake, but sounds resonable

  7. blckholehorizon on September 23, 2008 12:18 pm

    Thanks for the help! Worked like a charm!

Sponsors




Links