lostAngel 2011-03-18 11:37:19 3419次浏览 4条回复 0 0 0

yii用gii创建骨架后可能大家会发现不登陆的情况下无法进行任何的操作,我想新建个注册选项可是没次点击注册选项都会先跳到登陆页面,希望能知道怎么修改

  • 回复于 2011-03-18 13:38 举报

    注意一下contorller里面

    public function accessRules() {
      return array(
        array('allow', // allow all users to perform 'index' and 'view' actions
          'actions' => array('index', 'view'),
          'users' => array('*'),
      ),
      array('allow', // allow authenticated user to perform 'create' and 'update' actions
        'actions' => array('create', 'update'),
        'users' => array('@'),
      ),
      array('allow', // allow admin user to perform 'admin' and 'delete' actions
        'actions' => array('admin', 'delete'),
        users' => array('admin'),
      ),
      array('deny', // deny all users
        'users' => array('*'),
      ),
    );
    }
    

    user=>array(/@/ )
    里面的
    代表所有人
    @代表所有登陆用户
    还可以详细到具体的那个用户,应该是这块的权限你没打开~

  • 回复于 2011-03-18 14:13 举报

    OK,谢谢了,兄弟

  • 回复于 2011-03-18 16:03 举报

    客气~嘿嘿

  • 回复于 2012-02-22 15:15 举报

    {:3_41:}huicha灰常感谢

您需要登录后才可以回复。登录 | 立即注册