You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.4 KiB

<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yii\rbac;
use Yii;
use yii\base\Object;
/**
* Assignment represents an assignment of a role to a user.
* It includes additional assignment information such as [[bizRule]] and [[data]].
* Do not create a Assignment instance using the 'new' operator.
* Instead, call [[Manager::assign()]].
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @author Alexander Kochetov <creocoder@gmail.com>
* @since 2.0
*/
class Assignment extends Object
{
/**
12 years ago
* @var Manager the auth manager of this item
*/
12 years ago
public $manager;
/**
12 years ago
* @var string the business rule associated with this assignment
*/
12 years ago
public $bizRule;
/**
12 years ago
* @var mixed additional data for this assignment
*/
12 years ago
public $data;
/**
12 years ago
* @var mixed user ID (see [[User::id]]). Do not modify this property after it is populated.
* To modify the user ID of an assignment, you must remove the assignment and create a new one.
*/
12 years ago
public $userId;
/**
12 years ago
* @return string the authorization item name. Do not modify this property after it is populated.
* To modify the item name of an assignment, you must remove the assignment and create a new one.
*/
12 years ago
public $itemName;
/**
* Saves the changes to an authorization assignment.
*/
public function save()
{
12 years ago
$this->manager->saveAssignment($this);
}
}