Can Sugar Mobile be restricted to read only?

Can the Sugar Mobile app be restricted to read-only across the board?

  • Hey Francesca,

    Currently there's no mobile sdk, although SugarCRM are developing one. You can view the preview here - The specified item was not found..

    If you don't mind the edits just simply not working (rather than the edit button being removed). In theory I'd suggest the following:

    • Create a new field on any module (e.g. Accounts), call it stop_save. Make it default to checked. Do not put it on any views.
    • Write a script in custom/modules/Accounts/clients/base/views/record/record.js that unchecks it (you'll also have to override the create actions, listview, etc.) on the model after render
    • In the before_save logic hook, call sugar_die(); if the checkbox is checked
    • In an after_save logic hook, call the DBManager and write a sql script that checks it again

    In theory, this would prevent saving in mobile - the sugar_die would kill any api call that doesn't come from mobile. It'd also stop anything other than sidecar updating sugar (unless you remember to uncheck stop_save). This is also a massive hack, and it could cause unexpected behaviour all round.

    If you want to make a unsafe non-upgradeable customisation, I'd suggest start digging around in the /mobile/ folder.

    I'd loop in Greg Khanlarov and Joe Mao as they'll know more. Unfortunately you also just missed Sugar Online User Group: SugarCRM Mobile with Joseph Mao. But Sarah Friedlander Garcia and Sravanthi Bellamkonda attended, maybe they know more about what's about to happen?

    Hope this helps,

    Alan

  • Is your need to make it read only specific to a specific role?  If so, you could create a role that was read only privileges. What is the use case where you would want mobile to be read only but have write privileges on the browser? In theory any user that has access to the browser (eg even on a mobile browser) would get write privileges and thus working around the read only privileges unless it was role based.

    Can you please expand more if a role based read only solution solves your need? 

  • Thanks Joe,

    It is my understanding that the Mobile app allows off-line edits that are later sync'd when you get a network connection.

    Some in our company have a concern that editing things offline may cause sync issues with changes made live on the app by others. Since the need for mobile is primarily as a lookup tool, they want to remove the ability to ever edit anything from mobile. Perhaps a better solution would be to disable off-line editing and still allow changes when users are online via VPN.

    We are On-Site & entirely behind a firewall.

    thank you,

    Francesca

  • If the concern is specifically regarding sync, your proposal to disable offline mode is the best way to proceed.