controllers/AssignmentController.php
protected function getAssignmentOptions($userId)
    {
        $options = array();

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

        $assignments = $am->getAuthAssignments($userId);
        $assignedItems = array_keys($assignments);

        /* @var $authItems CAuthItem[] */
        $authItems = $am->getAuthItems();
        foreach ($authItems as $itemName => $item) {
            if (!in_array($itemName, $assignedItems)) {
                $options[$this->capitalize($this->getItemTypeText($item->type, true))][$itemName] = $item->description;
            }
        }

        return $options;
    }
protected function getAssignmentOptions($userId)
    {
        $options = array();

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

        $assignments = $am->getAuthAssignments($userId);
        $assignedItems = array_keys($assignments);

        /* @var $authItems CAuthItem[] */
        $authItems = $am->getAuthItems();
        foreach ($authItems as $itemName => $item) {
            if (!in_array($itemName, $assignedItems)) {
                $options[$this->capitalize($this->getItemTypeText($item->type, true))][$itemName] = $item->description;
            }
        }

        return $options;
    }
protected function getAssignmentOptions ( $ userId ) { $ options = array ( ) ; /* @var $am CAuthManager|AuthBehavior */ $ am = Yii :: app ( ) -> authManager ; $ assignments = $ am -> getAuthAssignments ( $ userId ) ; $ assignedItems = array_keys ( $ assignments ) ; /* @var $authItems CAuthItem[] */ $ authItems = $ am -> getAuthItems ( ) ; foreach ( $ authItems as $ itemName => $ item ) { if ( ! in_array ( $ itemName , $ assignedItems ) ) { $ options [ $ this -> capitalize ( $ this -> getItemTypeText ( $ item -> type , true ) ) ] [ $ itemName ] = $ item -> description ; } } return $ options ; }
Returns a list of possible assignments for the user with the given id.
@param string $userId the user id.
@return array the assignment options.
Returns a list of possible assignments for the user with the given id .