def check_access(self, role, methodname, obj, attr):
        """ Raise :class:`RoleError` if invalid access. """
        if attr in ('command', 'get_access_controller') and \
           methodname == '__setattr__':
            raise RoleError('No %s access to %r' % (methodname, attr))
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/components/external_code.py/_AccessController.check_access/original