yiisoft / yii2

Yii 2: The Fast, Secure and Professional PHP Framework
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
14.24k stars 6.91k forks source link

RBAC DbManager #10006

Closed Svyatoslav-S closed 9 years ago

Svyatoslav-S commented 9 years ago

DbManager.php line 749 Should be removed or commented

public function assign($role, $userId)
{
    $assignment = new Assignment([
        'userId' => $userId,
        'roleName' => $role->name,

        'createdAt' => time(), // !!! Should be commented or elliminated

    ]);

    $this->db->createCommand()
        ->insert($this->assignmentTable, [
            'user_id' => $assignment->userId,
            'item_name' => $assignment->roleName,
          //  'created_at' => $assignment->createdAt,
        ])->execute();

    return $assignment;
}
samdark commented 9 years ago

Why?

Svyatoslav-S commented 9 years ago

Because in Yii2 2.0.6 Assignment.php: <?php /**

namespace yii\rbac;

use Yii; use yii\base\Object;

/**

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! No property! /* * @var integer UNIX timestamp representing the assignment creation time / // public $createdAt; }