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 !

  • Hello Hats!

    Thanks you for this answer, it really helped!

    But I have a question about this, I followed all these steps and after both repairs Sugar should have created a file in "custom/application/Ext/Include" with the contents of "custom/Extension/application/Include/custom_pc_bean_registry.php" but it did not.

    Have you ever encountered this problem in Sugar 9.0? Do you know what can cause it?

    If I add the contents manually in my local instance, everything works fine.

  • Hi Lucas Albero,

    You mean you created a file in custom/Extension/application/Ext/Include and after repair, the file contents didn't get appended to custom/application/Ext/Include/modules.ext.php?

    Also, if you are on Linux, please verify the permissions are okay.

    https://support.sugarcrm.com/Knowledge_Base/Platform_Management/Required_File_System_Permissions_on_Linux/ 

    https://support.sugarcrm.com/Knowledge_Base/Platform_Management/Setting_Default_File_Permissions_and_Ownership_Via_confi… 

    Let us know how it goes.

    Regards.

Reply Children