Can't delete entity even when using $is_admin=TRUE

I created a plugin which includes a kind of discussion board. Some users of this forum are assigned as moderators (user->moderator metadata). I want this users to be able to delete other users postings. Each posting is saved as an object (subtype "posting"). So the following is my delete action:

    require_once(dirname(dirname(dirname(dirname(dirname(__FILE__))))) . "/engine/start.php");
    action_gatekeeper();
    if(get_loggedin_user()->moderator){
        global $is_admin;
        $is_admin = TRUE;
    }
    $entity = get_entity(mypostingid);
    $entity->delete();
    $is_admin = FALSE;

I can see the entity when using print_r($entity). But I can't delete it. Any suggestions why? Does is_admin not allow me to delete entites from other users?

Thanks,

Peter