if (isset($user['role']) && $user['role'] === 'admin') {
return true;
}
+
+
$this->Flash->error(__('You are not allowed to do that.'));
// Par défaut refuser
return false;
// Allow users to register and logout.
// You should not add the "login" action to allow list. Doing so would
// cause problems with normal functioning of AuthComponent.
- $this->Auth->allow(['index','logout','digest']);
+ $this->Auth->allow(['index','logout','view']);
}
}