Product Catalog to be editable by non-admin

Hi Everyone,

Just wondering if anyone have ever had any experience doing some customisation for Role / Product Catalog.

I am currently trying to get Product Catalog to be editable by a non-admin user. Just wondering if this is somehow possible ? Preferably, we would like to set this up using Role Management rather than inserting a User ID.

Your advice is greatly appreciated. Thanks Guys !

Parents
  • Hi Jimmy Prasetyo,

    I hope you have find the way on your own. If not (and for other people), please follow the steps to enable "ACL" for Product Catalog module which is only admin accessible by default.

    Enable the ACL access in ProductTemplate bean file by overriding the bean.

    1. Create new file in custom/modules/ProductTemplates/ProductTemplate.php

    <?php

    /**
    * Overriding bean to enable ACL for this module.
    */

    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;
        }
    }

    2. Register your custom bean in custom/Extension/application/Ext/Include/custom_pc_bean_registry.php

    <?php

    /**
    * Overriding PC bean to enable ACL.
    */

    $objectList['ProductTemplates'] = 'ProductTemplate';
    $beanList['ProductTemplates'] = 'CustomProductTemplate';
    $beanFiles['CustomProductTemplate'] = 'custom/modules/ProductTemplates/ProductTemplate.php';
    $moduleList[] = 'ProductTemplates';

    3. Create a vardef entry for ACL in custom/Extension/modules/ProductTemplates/Ext/Vardefs/enable_acl.php

    <?php

    /**
    * Overriding PC bean to enable ACL.
    */

    $dictionary['ProductTemplate']['acls'] = array('SugarACLLockedFields' => true, 'SugarACLStatic' => true);

    4. Navigate to Admin -> Repair, perform Quick Repair & Rebuild.

    5. Navigate to Admin -> Repair, perform Repair Roles.

    You are good to go after these steps and you will be able to see "Product Catalog" module available under Role Management. Drag the module to Displayed Modules panel under Admin -> Display Modules and Subpanels and it will be accessible by non-admin users as well.

    Let us know if this helps.

    Please note: above steps are only to enable ACL and not team security. For team security, we need to add additional vardef file. Please let me know if that is needed.

    Regards.

  • Hi hats,

    Thanks for taking the time to help me out on this one. Appreciate the help !

Reply Children
No Data