#549 - Security group inheritance in email attachments
Hi Jason,
Using opacus thunderbird connector we are facing an issue with security group. When you archive an email with attachment to a record (an opportunity in our case), the email inherits the opportunity security group correctly but attachments does not. So user with group permission on notes cannot see the attachments.
Can you track and solve this on your side? Thanks. Luca
10 years ago
Email attachments can be tricky as they seem to be created before the actual email gets created (or before groups are associated to the email). This means that the groups wouldn't get inherited to the attachment record (which is a note record in Sugar). It's hard to pinpoint what is happening in the case of the Opacus solution, but you could get around it by adding an email logic hook and after_save go pull up any attachments and manually assign any groups associated to the email to the note as well. It may be that you would need to do an after_save hook on the notes module instead. It's hard to say which one, but one of them would work.
Adding a group to a record via a logic hook is pretty easy. This example is a great start: https://www.sugaroutfitters.com/docs/securitysuite/developer-tips#fieldchange
The only difference is that you would be pulling the groups from the email record and assigning each one to the note. There are some examples on how to get related records for a bean (which is what a group is) here: http://developer.sugarcrm.com/2012/03/23/howto-using-the-bean-instead-of-sql-all-the-time/
Yes, this would require some code so if you are not comfortable with that then you would need to bring someone on to help with this task.
-Jason
10 years ago
Great tip. I will try to do that. Thanks. Luca