0

I am working on cakePHP (version 4.0.5) and when I tried to run

bin/cake bake policy --type entity Name

command, It'll gives an error .

Error: Unknown option type.

Can anyone encounter such problem and have any solution,kindly share...

  • try `bin/cake policy --type entity Name` because https://github.com/cakephp/authorization/tree/master/src/Command – Salines Apr 30 '20 at 07:32
  • 1
    @Salines It's a bake command, it is being [**registered as `bake policy`**](https://github.com/cakephp/authorization/blob/2.0.3/src/Plugin.php#L37). – ndm Apr 30 '20 at 10:28
  • @ndm OK, I don't use it, only have quick look at source code – Salines Apr 30 '20 at 10:54

1 Answers1

2

I just ran into this message when I missed loading the Authorization plugin. Check you have loaded the plugin by adding the following statement to the bootstrap() method in src/Application.php:

$this->addPlugin('Authorization');

reference: https://book.cakephp.org/4/en/tutorials-and-examples/cms/authorization.html

rogyw
  • 36
  • 4