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
56 lines
1.4 KiB
12 years ago
|
<?php
|
||
|
/**
|
||
|
* @link http://www.yiiframework.com/
|
||
|
* @copyright Copyright (c) 2008 Yii Software LLC
|
||
|
* @license http://www.yiiframework.com/license/
|
||
|
*/
|
||
|
|
||
12 years ago
|
namespace yii\rbac;
|
||
12 years ago
|
|
||
|
use Yii;
|
||
|
use yii\base\Object;
|
||
|
|
||
|
/**
|
||
12 years ago
|
* 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.
|
||
12 years ago
|
* Instead, call [[Manager::assign()]].
|
||
12 years ago
|
*
|
||
12 years ago
|
* @author Qiang Xue <qiang.xue@gmail.com>
|
||
|
* @author Alexander Kochetov <creocoder@gmail.com>
|
||
|
* @since 2.0
|
||
|
*/
|
||
12 years ago
|
class Assignment extends Object
|
||
12 years ago
|
{
|
||
|
/**
|
||
12 years ago
|
* @var Manager the auth manager of this item
|
||
12 years ago
|
*/
|
||
12 years ago
|
public $manager;
|
||
12 years ago
|
/**
|
||
12 years ago
|
* @var string the business rule associated with this assignment
|
||
12 years ago
|
*/
|
||
12 years ago
|
public $bizRule;
|
||
12 years ago
|
/**
|
||
12 years ago
|
* @var mixed additional data for this assignment
|
||
12 years ago
|
*/
|
||
12 years ago
|
public $data;
|
||
12 years ago
|
/**
|
||
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
|
*/
|
||
12 years ago
|
public $userId;
|
||
12 years ago
|
/**
|
||
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
|
*/
|
||
12 years ago
|
public $itemName;
|
||
12 years ago
|
|
||
|
/**
|
||
|
* Saves the changes to an authorization assignment.
|
||
|
*/
|
||
|
public function save()
|
||
|
{
|
||
12 years ago
|
$this->manager->saveAssignment($this);
|
||
12 years ago
|
}
|
||
12 years ago
|
}
|