Check team base permission using logic hooks

Hello,

According to Sugar documentation you can enable team based permissions by default, so when an user is creating a record the team default permissions is checked. 

If the Administrator has enabled team-based permissions, you may optionally indicate whether the teams on each set should be automatically set to "selected" (Additional Permissions Enabled). source

But this is not working as expected as seen in this bug (79318)

This is affecting some of our clients and we are looking for a way to set this using some customization.

One resolution we thought is to check the team base permissions in a logic hook, but we couldn't find what variable in the $bean to mark for this.

Is there a way(or any other way) to do this? This workaround would be very welcome since not having the team based permission marked as default really compromises the user experience.

  • Hi Lucas Albero,

    EDIT: Defect 79318 is fixed in 9.0.0!

    Attached is an example of an application hook a developer might have made for a previous version of Sugar that partially replicates the expected behavior.

    Note: This logic hook is not supported by SugarCRM and is only offered here as an example approach to a workaround. A logic hook will not scale the same way the supported code fix in 9.0.0 does.

    The logic hook is added to the custom directory so it fires for all modules.

    It checks the config to ensure team-based permissions are set, and it only triggers for modules that have the necessary acl_team_set_id field.

    The differences between this logic hook's behavior and the proper fix at the client/js level include:

    • this logic hook will overwrite any changes the user manually makes to the record's team selections before saving the record for the first time.
    • this hook will not work for imported records, only those made in the user interface.

    I hope this helps!