<?php
/**
 * 角色授权
 * Yii RBAC管理体系,角色增加行为,只提供了Ajax请求
 * @author ouyang
 * @eamil oyjqdlp@126.com
 * @updated 2010-07-08
 */
class RoleAddChildAction extends BaseAction
{
    public function run()
    {
        if(Yii::app()->request->getIsAjaxRequest())
        {
             $name = $_POST['rolename'];
             $assign = $_POST['assign'];
             $role = $this->getController()->getRole($name);
             $assign = $this->getController()->removeAssign($role,$assign);
             $this->getController()->assign($role,$assign);
        }
    }  
}

