CakePHP 3 and ACL plug in - cakephp

I am trying to make a simple ACL using CakePHP 3, and there are no tutorials for it in the cook book (only for cakephp 2 and now acl doesn't exist in cakephp3)
Question 1
I am trying to install the acl plugin from https://github.com/cakephp/acl, how may I do that?
Question 2
Is there any comprehensive and beginner friendly tutorial on how to make an ACL on CakePHP3? I've trying searching everywhere, but found nothing. If anyone could guide me on how to do a simple one it would be much appreciated.
Many thanks

USE cakephp-3acl-example project to creating permission and granding permission for users
https://github.com/mattmemmesheimer/cakephp-3-acl-example

Question 1 I am trying to install the acl plugin from https://github.com/cakephp/acl, how may I do that?
Like any other plugin? See the documentation.
The readme.md itself contains instructions as well but also a warning:
Note: This is a non-stable plugin for CakePHP 3.0 at this time. It is
currently under development and should be considered experimental.
Maybe try it and provide feedback to the developers?
Question 2 Is there any comprehensive and beginner friendly tutorial on how to make an ACL on CakePHP3? I've trying searching everywhere, but found nothing.
If anyone could guide me on how to do a simple one it would be much appreciated.
ACL is always the same, if you know how ACL works you can implement it in any language and framework. If you don't know how, read about how ACL in general works.
But a better idea might to simply use the plugin you already found and help testing and completing it if you encounter issues.

burzum is correct that the installation instructions and documentation are available at https://github.com/cakephp/acl .
I am cutting over from a 1.3 implementation so have not gone through setting up a new acl database.
I have not seen a comprehensive doc on how to setup ACL, the 'short' version I have in my notes is:
1) setup 'Auth' as per the blog example (yes Auth is not ACL but this is what I am using it for)
2) install ACL using composer
3) override 'isAuthorized' in AppController with a check like:
...
use Acl\Controller\Component\AclComponent;
use Cake\Controller\ComponentRegistry;
...
public function isAuthorized($user){
$Collection = new ComponentRegistry();
$acl= new AclComponent($Collection);
$username=$user['username'];
$controller=$this->request->controller;
$action=$this->request->action;
$check=$acl->check($user['username'],"$controller/$action");
return $check;
}

You can follow this plugin.
CakePhp3-AclManager
And the tutorial (step by step) here
If you don't know Japan language, use google translate.
Good luck.

Related

Datatable Plugin for CakePHP 4

I have been upgrading my application from cakephp 3 to cakephp 4. I was using fheider/cakephp-datatables and I have come across ypnos-web/cakephp-datatables where both support cakephp 3.
I am currently looking for a cakephp-datatable plugin which supports cakephp 4.
If anybody has an idea, I would be happy.
Thanks in Advance.
Isn't the built-in pagination is what you are looking for ? you can do advanced dynamic database links with your HTML tables.
I successfully use ypnos-web/cakephp-datatables on CakePHP 4.2.7. It works very well for me.
You might have to play around a bit to get it working correctly. Read some of the issues (open and closed) on the ypnos-web/cakephp-datatables github repository and you can likely get it working.
Good Luck!

Hide all references to framework cakePHP

For security purposes id like to hide all references to the CakePHP framework that I have used to build my site. Can anyone offer any help on the best way to go about this pls? so far Google hasn't yielded any useful results.
The real, non-sarcastic answer is:
There's absolutely no reason to hide the fact that your app was built in CakePHP - for security purposes, or any other purposes. Just don't worry about it.
For debug mode 2 (which you must have for a production site) as far as i have seen only cookie has a mention of cakephp which you can remove simply using
Configure::write('Session.cookie', YourCustomCookieName);

Using Dwoo 2.0 in CakePHP

Heading
Hey,
I would like to use the new Dwoo 2.0 Template Engine in my CakePHP app. But I can't find any manual with a step by step instruction. I know it's just in a beta status but it would be great if someone could help me out.
You might want to follow up on
https://github.com/ganglia/ganglia-web/tree/master/dwoo/Dwoo/Adapters/CakePHP
and make this some clean "Dwoo" Plugin with a DwooView class you can then switch out via
$this->viewClass = 'Dwoo.Dwoo';
See https://github.com/predominant/TwigView as an example how its done properly (in this case for Twig, though).
Don't forget some test cases and a good documentation and I bet in no time lots of other people will join in and also use and enhance your view class.
if you want to use Dwoo 2 with CakePHP framework, it's possible to ork with you to update the Dwoo 1 Adapter to the version 2 of Dwoo.
Let me know!
best regards

where can i download simple code acl project in cakephp

i am beginner in cakephp and i need to correct and sample code for acl in cake.
i follow this tutorial :
http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application
but i can't use well.
thanks.
Check out part 2 of this tutorial: http://www.ibm.com/developerworks/opensource/tutorials/os-php-cake1/index.html
I found it useful, it walks you through exactly how to do it.

cakephp multilingual website

We're planning for a multi language website, Any idea/tricks how can we achieve the same?
Are there some ready made components/plug-ins available in CakePHP like in open source technologies?
Kindly let me know.
Thanks !
CakePHP comes with its own i18n and l11n functions. They work well for my projects and if you don't have any other requirements they should be fine for you too. Have a look at the CakePHP book for more.

Resources