Skip to content

Instantly share code, notes, and snippets.

@hatimalam
Created June 25, 2019 04:46
Show Gist options
  • Save hatimalam/6d1930daf8d59443150eb6e31d2791e6 to your computer and use it in GitHub Desktop.
Save hatimalam/6d1930daf8d59443150eb6e31d2791e6 to your computer and use it in GitHub Desktop.
Custom Product Catalog Bean File
<?php
/**
* Overriding PC bean to enable ACL
* custom/modules/ProductTemplates/ProductTemplate.php
*/
require_once("modules/ProductTemplates/ProductTemplate.php");
class CustomProductTemplate extends ProductTemplate
{
public function __construct()
{
parent::__construct();
// enable row level security
$this->disable_row_level_security = false;
}
//implement ACL access for ProductTemplate module
public function bean_implements($interface)
{
switch ($interface) {
case 'ACL':
return true;
}
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment