controllers/AssignmentController.php
public function actionRevoke()
    {
        if (isset($_GET['itemName'], $_GET['userId'])) {
            $itemName = $_GET['itemName'];
            $userId = $_GET['userId'];

            /* @var $am CAuthManager|AuthBehavior */
            $am = Yii::app()->getAuthManager();

            if ($am->isAssigned($itemName, $userId)) {
                $am->revoke($itemName, $userId);
                if ($am instanceof CPhpAuthManager) {
                    $am->save();
                }

                if ($am instanceof ICachedAuthManager) {
                    $am->flushAccess($itemName, $userId);
                }
            }

            if (!isset($_POST['ajax'])) {
                $this->redirect(array('view', 'id' => $userId));
            }
        } else {
            throw new CHttpException(400, Yii::t('AuthModule.main', 'Invalid request.'));
        }
    }
public function actionRevoke()
    {
        if (isset($_GET['itemName'], $_GET['userId'])) {
            $itemName = $_GET['itemName'];
            $userId = $_GET['userId'];

            /* @var $am CAuthManager|AuthBehavior */
            $am = Yii::app()->getAuthManager();

            if ($am->isAssigned($itemName, $userId)) {
                $am->revoke($itemName, $userId);
                if ($am instanceof CPhpAuthManager) {
                    $am->save();
                }

                if ($am instanceof ICachedAuthManager) {
                    $am->flushAccess($itemName, $userId);
                }
            }

            if (!isset($_POST['ajax'])) {
                $this->redirect(array('view', 'id' => $userId));
            }
        } else {
            throw new CHttpException(400, Yii::t('AuthModule.main', 'Invalid request.'));
        }
    }
public function actionRevoke ( ) { if ( isset ( $ _GET [ 'itemName' ] , $ _GET [ 'userId' ] ) ) { $ itemName = $ _GET [ 'itemName' ] ; $ userId = $ _GET [ 'userId' ] ; /* @var $am CAuthManager|AuthBehavior */ $ am = Yii :: app ( ) -> getAuthManager ( ) ; if ( $ am -> isAssigned ( $ itemName , $ userId ) ) { $ am -> revoke ( $ itemName , $ userId ) ; if ( $ am instanceof CPhpAuthManager ) { $ am -> save ( ) ; } if ( $ am instanceof ICachedAuthManager ) { $ am -> flushAccess ( $ itemName , $ userId ) ; } } if ( ! isset ( $ _POST [ 'ajax' ] ) ) { $ this -> redirect ( array ( 'view' , 'id' => $ userId ) ) ; } } else { throw new CHttpException ( 400 , Yii :: t ( 'AuthModule.main' , 'Invalid request.' ) ) ; } }
Revokes an assignment from the given user.
@throws CHttpException if the request is invalid.
Revokes an assignment from the given user .