<?php
class Plugg_User_Admin_Auth_Authdata extends Plugg_RoutingController
{
    function Plugg_User_Admin_Auth_Authdata()
    {
        parent::__construct('List', 'Plugg_User_Admin_Auth_Authdata_', dirname(__FILE__) . '/Authdata');
        $this->addControllerFilter(array('Delete'), 'isValidAuthdataRequested');
    }

    function _doGetRoutes(Sabai_Application_Context $context)
    {
        return array(
            'list' => array('controller' => 'List'),
            'submit' => array('controller' => 'Submit'),
            ':authdata_id/remove' => array(
                'controller' => 'Delete',
                'requirements' => array(':authdata_id' => '\d+')
            )
        );
    }

    function isValidAuthdataRequestedBeforeFilter(Sabai_Application_Context $context)
    {
        $this->_parent->getParent()->isValidEntityRequested($context, 'Authdata');
    }

    function isValidAuthdataRequestedAfterFilter(Sabai_Application_Context $context){}
}