CAuthAssignment

优质
小牛编辑
130浏览
2023-12-01
所有包 | 属性 | 方法
system.web.auth
继承class CAuthAssignment » CComponent
源自1.0
版本$Id: CAuthAssignment.php 3426 2011-10-25 00:01:09Z alexander.makarow $
源码framework/web/auth/CAuthAssignment.php
CAuthAssignment代表分配给用户角色的任务。 它包含着额外的任务信息,如bizRule和data。 不要使用‘new’操作来实例化CAuthAssignment对象, 应该使用IAuthManager::assign来进行此操作。

公共属性

隐藏继承属性

属性类型描述定义在
bizRulestring这个任务关联的业务规则。CAuthAssignment
datamixed这个任务的额外的数据。CAuthAssignment
itemNamestring授权项目名字。CAuthAssignment
userIdmixed用户ID(请参考IWebUser::getId)CAuthAssignment

公共方法

隐藏继承方法

方法描述定义在
__call()如果类中没有调的方法名,则调用这个方法。CComponent
__construct()构造方法。CAuthAssignment
__get()返回一个属性值、一个事件处理程序列表或一个行为名称。CComponent
__isset()检查一个属性是否为null。CComponent
__set()设置一个组件的属性值。CComponent
__unset()设置一个组件的属性为null。CComponent
asa()返回这个名字的行为对象。CComponent
attachBehavior()附加一个行为到组件。CComponent
attachBehaviors()附加一个行为列表到组件。CComponent
attachEventHandler()为事件附加一个事件处理程序。CComponent
canGetProperty()确定属性是否可读。CComponent
canSetProperty()确定属性是否可写。CComponent
detachBehavior()从组件中分离一个行为。CComponent
detachBehaviors()从组件中分离所有行为。CComponent
detachEventHandler()分离一个存在的事件处理程序。CComponent
disableBehavior()禁用一个附加行为。CComponent
disableBehaviors()禁用组件附加的所有行为。CComponent
enableBehavior()启用一个附加行为。CComponent
enableBehaviors()启用组件附加的所有行为。CComponent
evaluateExpression()计算一个PHP表达式,或根据组件上下文执行回调。CComponent
getBizRule()返回这个任务关联的业务规则。CAuthAssignment
getData()返回这个任务的额外的数据。CAuthAssignment
getEventHandlers()返回一个事件的附加处理程序列表。CComponent
getItemName()返回授权项目名字。CAuthAssignment
getUserId()返回用户ID(请参考IWebUser::getId)CAuthAssignment
hasEvent()确定一个事件是否定义。CComponent
hasEventHandler()检查事件是否有附加的处理程序。CComponent
hasProperty()确定属性是否被定义。CComponent
raiseEvent()发起一个事件。CComponent
setBizRule()设置这个任务关联的业务规则。CAuthAssignment
setData()设置这个任务的额外的数据。CAuthAssignment

属性详细

bizRule 属性 public string getBizRule()
public void setBizRule(string $value)

这个任务关联的业务规则。

data 属性 public mixed getData()
public void setData(mixed $value)

这个任务的额外的数据。

itemName 属性 只读 public string getItemName()

授权项目名字。

userId 属性 只读 public mixed getUserId()

用户ID(请参考IWebUser::getId)

方法详细

__construct() 方法
public void __construct(IAuthManager $auth, string $itemName, mixed $userId, string $bizRule=NULL, mixed $data=NULL)
$authIAuthManager授权管理者。
$itemNamestring授权项目名字。
$userIdmixed用户ID(请参考IWebUser::getId)
$bizRulestring这个任务关联的业务规则。
$datamixed这个任务的额外的数据。
源码: framework/web/auth/CAuthAssignment.php#43 (显示) publicfunction__construct($auth,$itemName,$userId,$bizRule=null,$data=null)
{
$this->_auth=$auth;
$this->_itemName=$itemName;
$this->_userId=$userId;
$this->_bizRule=$bizRule;
$this->_data=$data;
}

构造方法。

getBizRule() 方法
public string getBizRule()
{return}string这个任务关联的业务规则。
源码: framework/web/auth/CAuthAssignment.php#71 (显示) publicfunctiongetBizRule()
{
return$this->_bizRule;
}
getData() 方法
public mixed getData()
{return}mixed这个任务的额外的数据。
源码: framework/web/auth/CAuthAssignment.php#91 (显示) publicfunctiongetData()
{
return$this->_data;
}
getItemName() 方法
public string getItemName()
{return}string授权项目名字。
源码: framework/web/auth/CAuthAssignment.php#63 (显示) publicfunctiongetItemName()
{
return$this->_itemName;
}
getUserId() 方法
public mixed getUserId()
{return}mixed用户ID(请参考IWebUser::getId)
源码: framework/web/auth/CAuthAssignment.php#55 (显示) publicfunctiongetUserId()
{
return$this->_userId;
}
setBizRule() 方法
public void setBizRule(string $value)
$valuestring这个任务关联的业务规则。
源码: framework/web/auth/CAuthAssignment.php#79 (显示) publicfunctionsetBizRule($value)
{
if($this->_bizRule!==$value)
{
$this->_bizRule=$value;
$this->_auth->saveAuthAssignment($this);
}
}
setData() 方法
public void setData(mixed $value)
$valuemixed这个任务的额外的数据。
源码: framework/web/auth/CAuthAssignment.php#99 (显示) publicfunctionsetData($value)
{
if($this->_data!==$value)
{
$this->_data=$value;
$this->_auth->saveAuthAssignment($this);
}
}