Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
根据我的研究,我认为这是不可能的,但我想确定一下。是否可以通过 accessRules 将参数传递给 RBAC bizRule。现在我需要在允许他们编辑/删除帖子之前检查某人是否是帖子所有者(以及其他检查)。所以我需要比较 bizRule 中的 owner_id 来验证这一点,Yii::app()->user->id == param['owner_id']但我认为我不能使用 accessRules 传递该参数?或者我可以吗?
Yii::app()->user->id == param['owner_id']
你不能这样做。
不同的操作需要不同的 bizRules。因此,在任何可能的操作执行之前为所有这些加载数据将是低效的。
'return yii::app()->user->id==Business::model()->findByPk($_GET["id"])->create_user_id;';
这是我在更新过程中为找到 id 而提供的