Disable record's creation

Hello everybody !

I have a really urgent problem to solve :

How can i disable the "creation" of new records (in standdard modules like Accounts, but in custom too) for few users?

I was thinking about roles, but there is nothing on the role management.
I would like to disable the creation of new Accounts for the role "lambda user".

of course, we have to take care of disable "duplication" too.

By disable, i mean, disallowed access to the button "create" and "duplicate" and to disallowed the action.

Do you know how to disable the action of creation/duplication and how to hide the "create"/"duplicate" buttons ?

Thanks a lot !

ps : Im on Sugar 7.5.1 Pro
Parents
  • Hi GaelleFernandez

    You can set access for Edit to none in roles management for Accounts module for this particular role.
    Then users come under that role won't be able to edit,create or duplicate an account

    Thanks!
  • Creation of records is governed by the "Edit" ACL on backend.  So you need to do some customizations in order to disable Create actions but not Edit actions.  However, on the front end, we've already started adding some support for a "Create" ACL.  You can modify the User's ACLs object to utilize this.  Or you could override the /me API endpoint that returns the User's ACLs to include additional "create" permissions for any "lambda user".

    Try this in your browser.
    var acls = SUGAR.App.user.getAcls();
    acls.Accounts.create = 'no';
    SUGAR.App.user.set("acls", acls);
    And then navigate away and then back to Accounts module to force a re-render.  The "Create" button at the top will disappear and if you navigate into an Account record you will find the "Copy" or "Duplicate" buttons no longer appear in action dropdown.

    Of course, you can always just manipulate DOM directly.  For example, if you could add CSS "disabled" class to these buttons which will disable them visually and then remove any jQuery event listeners that might be on these elements to prevent actions from being triggered.  Or just remove these elements all together.

    App Ecosystem @ SugarCRM

  • Hi Gaelle,

    record.js is for Record View, this view is for existing records. There are a lot of views where a user can create a record for modules. Some of them are as follows:

    1. Menu Bar
    2. Module's List View
    3. Subpanels 
    4. Selection List View
    5. Quick Create

    There would be a lot of files that you need to modify if your aim is to hide/disable the "Create" button/menu. It would be more practical to just apply the restrictions on the "Create" views (clients/base/views/create-actions and clients/base/views/create).

    Regards!

Reply
  • Hi Gaelle,

    record.js is for Record View, this view is for existing records. There are a lot of views where a user can create a record for modules. Some of them are as follows:

    1. Menu Bar
    2. Module's List View
    3. Subpanels 
    4. Selection List View
    5. Quick Create

    There would be a lot of files that you need to modify if your aim is to hide/disable the "Create" button/menu. It would be more practical to just apply the restrictions on the "Create" views (clients/base/views/create-actions and clients/base/views/create).

    Regards!

Children
No Data