@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | $this->loadComponent('Flash'); |
| 46 | 46 | $this->loadComponent('Security'); |
| 47 | 47 | $this->loadComponent('Csrf'); |
| 48 | - $this->loadComponent('Auth', [ |
|
| 49 | - 'authorize' => ['Controller'], |
|
| 48 | + $this->loadComponent('Auth', [ |
|
| 49 | + 'authorize' => ['Controller'], |
|
| 50 | 50 | 'authenticate' => [ |
| 51 | 51 | 'Form' => [ |
| 52 | 52 | 'fields' => [ |
@@ -59,25 +59,25 @@ discard block |
||
| 59 | 59 | 'controller' => 'Users', |
| 60 | 60 | 'action' => 'login' |
| 61 | 61 | ], |
| 62 | - 'logoutAction' => [ |
|
| 62 | + 'logoutAction' => [ |
|
| 63 | 63 | 'controller' => 'Users', |
| 64 | 64 | 'action' => 'login' |
| 65 | 65 | ], |
| 66 | - 'unauthorizedRedirect' => $this->referer() |
|
| 67 | - ]); |
|
| 68 | - $this->Auth->deny(); |
|
| 66 | + 'unauthorizedRedirect' => $this->referer() |
|
| 67 | + ]); |
|
| 68 | + $this->Auth->deny(); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - public function isAuthorized($user) |
|
| 72 | - { |
|
| 73 | - // Admin can access every action |
|
| 74 | - if (isset($user['role']) && $user['role'] === 'admin') { |
|
| 75 | - return true; |
|
| 76 | - } |
|
| 71 | + public function isAuthorized($user) |
|
| 72 | + { |
|
| 73 | + // Admin can access every action |
|
| 74 | + if (isset($user['role']) && $user['role'] === 'admin') { |
|
| 75 | + return true; |
|
| 76 | + } |
|
| 77 | 77 | |
| 78 | - // Default permit |
|
| 79 | - return true; |
|
| 80 | - } |
|
| 78 | + // Default permit |
|
| 79 | + return true; |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | /** |