CakePHP Plugin ACL を利用する - 3
Plugin ACLを入れていきます。
7.Plugin ACLの導入をする。
・ダウンロードしたalaxos_acl_1.0.7.zipを解凍してaclフォルダを app/plugins に入れる。
app/config/core.php
・app/config/core.php の88行目の
Configure::write('Routing.prefixes', array('admin'));
のコメントを外す。
app/config/routes.php
・app/config/routes.php に
Router::connect('/admin', array('controller' => 'acl', 'action' => 'index', 'admin' => true));
を追加する。
app/config/bootstrap.php
・app/plugins/acl/config/bootstrap.php のソースをコピーして、app/config/bootstrap.php に貼り付ける
app/config/bootstrap.php
・app/config/bootstrap.phpに
Configure :: write('acl.aro.role.model', 'Role');
とあるが
Configure :: write('acl.aro.role.model', 'Group');
に変更する
8.アクセスして確認する。
http://localhost/portal/admin/acl
これで何の問題もなく表示されるはずです!
あとは、ユーザー、グループ、ページ、メソッドが追加、削除されたときに
admin/aclにアクセスすればPluginACLが教えてくれます。
アクセスしたときにチェックしてくれるのが良いですね。
