Ask Search:
Andrew OttaruAndrew Ottaru 

Permissions on a Custom object

I have this custom object with a lookup relationship with Opportunity, I would like this OWD Access to this object to be Private and give users access to records using Sharing Rules, I would also like Account Team members to have access to all records which are related to opportunities in their account.

Does anyone know how I can accomplish this?
Best Answer chosen by Andrew Ottaru
Johan YuJohan Yu
Yes, the user need to defined somewhere, but since this custom object is child of opportunity with a master detail relationship.
All user able to access opportunity will be able to access this child object.
So, the trigger is adding permission for user to access opportunity, since child of master-detail object will have no owner.

Hope this make sense.

All Answers

Johan YuJohan Yu
What is the relationship between this object with Account, is it via Opportunity?
Account Team is located in Account, I think you will need trigger for this.  
Andrew OttaruAndrew Ottaru
Hi Johan, sorry for late reply on this.
Yes the object is linked to Account via Opportunity.

If we could have everyone who has access to Opportunty to have access to this object and then bne able to give access to other users using Sharing Rule that will work as well.

I am not quite sre I understand how trigger will work on this. Thanks
Johan YuJohan Yu
How about make the custom object relate to Opportunity as Master-Detail relationship?
I think it will work.
see this blog for more information http://simplysfdc.blogspot.com/2012/11/master-detail-relationship.html
Andrew OttaruAndrew Ottaru
Thank you Johan, Having the custo object related to Master-Detail Reslationship seems to be working however, I am not able to give other users access using Sharing Rules. 

You had mentioned that I could use trigger do you know how that works?
Johan YuJohan Yu
Andrew, you do not need to have TRIGGER for user to access child record in master-detail relationship.
Once you add user as Opportunity Team or Account Team, user will be able to access child record
Hope this make sense.
Andrew OttaruAndrew Ottaru
Johan,

This make sense, however I would like to be able to give other users (not in the Account/ Opportunity Team) access to records in the custom object that is related to opportunity even when the users do not have access to opportunity.

I am guessing this is where I need TRIGGER?

Thanks for your help on this.

Johan YuJohan Yu
Yes, the user need to defined somewhere, but since this custom object is child of opportunity with a master detail relationship.
All user able to access opportunity will be able to access this child object.
So, the trigger is adding permission for user to access opportunity, since child of master-detail object will have no owner.

Hope this make sense.
This was selected as the best answer
Andrew OttaruAndrew Ottaru
Thanks Johan. This make sense.
Johan YuJohan Yu
Andrew, if any comment answer your question, please mark best answer to close this thread.