<?php

/**
 * Description of ListAllActionsAction
 * 列出所有的授权行为,提供是否启用该授权.
 *
 * @author ouyang
 */
class ListOperationsAction extends BaseAction
{
    public function run()
	{
        // 获取所有的Modules,Controllers,Actions.
        $modules = Helper::getAllModulesInfo();

        // 得到已启用的授权行为.
        $result = $this->getController()->getOperations();
        $hasoperations = array();
        if (!empty($result))
        {
            foreach ($result as $item)
            {
                $hasoperations[] = $item->name;
            }
        }

        $this->getController()->render('listoperations', array(
            'title'=>'授权行为',
            'modules'=>$modules,
            'hasoperations'=>$hasoperations));
    }
}
