HI,
we are installing the plugins we created for version 1.7.16 on CA 2.0.
Some parts of the code don't seem to work properly. For example, in one of our controllers we have the code:
class CSIMasterpieceController extends ActionController {
protected $o_db;
protected $user;
public function __construct(&$po_request, &$po_response, $pa_view_paths = NULL) {
parent::__construct($po_request, $po_response, $pa_view_paths);
$this->o_db = new Db("", NULL, false);
$this->user = $po_request->user;
$this->user_enabled = $this->user->canDoAction('can_use_csi_archive_manager');
// var_dump($this->user->canDoAction('can_use_csi_archive_manager')); <-- return always FALSE.
// var_dump($this->user); <-- return the user object.
On 1.7 the same plugin works correctly.
On the user permissions side (access control menu), the permission is set correctly. We also tried clearing the application cache and logging out and logging in, but to no avail, it always returns FALSE.
The database is a clone of the 1.7 version (updated to 2.0 version), with the same users and permissions.
I add that in the plugin file, the same code in the hookMenuBar returns TRUE:
public function hookRenderMenuBar( $pa_menu_bar ) {
$user = $this->getRequest()->user;
$user_enabled = $user->canDoAction('can_use_csi_archive_manager');
var_dump($user_enabled); die; // <-- returns TRUE
How can we fix it?