Patent ID: 7822723

Claim:
A method implemented in a computer system for controlling access to a sensitive function in a class in a computer readable storage medium, comprising: generating a friend object in the computer readable storage medium indicating at least one external function from at least one external class external to the class including the sensitive function, wherein the friend object and the sensitive function are in a same protected class, wherein the sensitive function can be accessed by members of the protected class and subclasses of the protected class, and wherein the friend object indicates multiple external functions from different external classes external to the protected class including the sensitive function; processing a call from a calling function in a class external to the protected class including the sensitive function and the friend object; permitting the calling function access to the sensitive function in response to determining that the friend object indicates that the calling function can access the sensitive function; and denying the calling function access to the sensitive function in response to determining that the friend object does not indicate that the calling function can access.