'Returns True if this role has the given permission, False otherwise.'

def has_permission(self, permission):

    course = modulestore().get_course(self.course_id)
    if (course is None):
        raise ItemNotFoundError(self.course_id)
    if permission_blacked_out(course, {self.name}, permission):
        return False
    return self.permissions.filter(name=permission).exists()
