'Method for checking if:
- a role is private and is the current user\'s private role
- a role is a sharing role and belongs to the current user'

def ok_to_display(self, user, role):

    if user:
        if (role.type == self.model.Role.types.PRIVATE):
            return (role == self.get_private_user_role(user))
        if (role.type == self.model.Role.types.SHARING):
            return (role in self.get_sharing_roles(user))
        return True
    return ((role.type != self.model.Role.types.PRIVATE) and (role.type != self.model.Role.types.SHARING))
