I have communities enabled in my org and i have a class which will auto add the new registered member to a chatter group.
CollaborationGroupMember cand = new CollaborationGroupMember(CollaborationGroupId=groupId, MemberId=UserId);
try {
insert cand;
System.debug('Success insert cand >>'+ cand );
} catch (DMLException e) {
System.debug('There was an error with the invite: '+e);
}
but when i execute the code it give me this error -> "Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Entity is read-only: CollaborationGroupMember: []"
I am guessing my communities default Guest account doesnt have the right to insert new collaborationgroupmember record. is there a way to extend this permission for this guest profile?