2 answers
Hi Neel88,Please check the links below for more information on thishttps://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_bulk_sharing_creating_with_apex.htmhttp://salesforce.stackexchange.com/questions/20894/sharing-access-to-partner-community-users-based-on-record-ownerBest RegardsNaga Kiran