Hi guys I am trying to delete sharing rules on a custom object (say myCustOb__cj) based on if the user is a portal/community user or an internal user. If the user is a portal user then delete the sharing but if not then do nothing. Something like this:
List<myCustObj__Share> sharesToDelete = [Select Id from myCustObj__Share WHERE id in :alistofaccount AND UserOrGroupId in :listofportalusersrecordssharedwith];
I have queried and got the list of accounts/records associated with the object whose shares I want to delete but I am not sure how to get the userorgroupid of the portal users that are associated with the accounts in my list whose access needs to be deleted. I am still get a grasp of Sharing using apex. Thanks.