How can we block users from creating records with the Accounts module? 

The users need to see all accounts but not have the ability to creating new records. Is there a setting I'm missing? It doesn't seem possible to do in roles.

Parents
  • John,

    In Role Management, you will want to create a new Role and set the "Edit" column to "None" for Accounts.  You can refer to this document for assistance.

    Hope this helps,

    Lori Arce

  • Hello John Harr,

    I hope you doing good.

    I have override the CurrentUserApi.Follow the below steps.

    1. /<projectname>/clients/base/api/CurrentUserApi.php To/<projectname>/custom/clients/base/api/CustomCurrentUserApi.php

    2. Add below code in the file CustomCurrentUserApi.php

    <?php  
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');  
    require_once("clients/base/api/CurrentUserApi.php");  
    class CustomCurrentUserApi extends CurrentUserApi  
    {  
       public function registerApiRest()  
       {  
           return parent::registerApiRest();  
       }  
        public function retrieveCurrentUser($api, $args)  
       {  
           $result = parent::retrieveCurrentUser($api, $args);  
                  $result['current_user']['acl']['Accounts']['create'] = 'no';     
           return $result;  
       }  
    }
    

    3. Do Quick Repair and Rebuild.

    Hope it will help you.

    Let me know if you need more help.

    -BPATEL

Reply
  • Hello John Harr,

    I hope you doing good.

    I have override the CurrentUserApi.Follow the below steps.

    1. /<projectname>/clients/base/api/CurrentUserApi.php To/<projectname>/custom/clients/base/api/CustomCurrentUserApi.php

    2. Add below code in the file CustomCurrentUserApi.php

    <?php  
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');  
    require_once("clients/base/api/CurrentUserApi.php");  
    class CustomCurrentUserApi extends CurrentUserApi  
    {  
       public function registerApiRest()  
       {  
           return parent::registerApiRest();  
       }  
        public function retrieveCurrentUser($api, $args)  
       {  
           $result = parent::retrieveCurrentUser($api, $args);  
                  $result['current_user']['acl']['Accounts']['create'] = 'no';     
           return $result;  
       }  
    }
    

    3. Do Quick Repair and Rebuild.

    Hope it will help you.

    Let me know if you need more help.

    -BPATEL

Children