bedezign / yii2-audit

Yii2 Audit records and displays web/cli requests, database changes, php/js errors and associated data.
https://bedezign.github.io/yii2-audit/
Other
193 stars 112 forks source link

implement with RBAC #137

Open zainalawaludin opened 8 years ago

zainalawaludin commented 8 years ago

Hi how to implement this extension on RBAC ? i want log each change like auth_item, auth_assigment, auth_item_child, but i confuse where i put 'bedezign\yii2\audit\AuditTrailBehavior'. FYI i use Yii::$app->authManager for CRUD. Thanks

cornernote commented 8 years ago

Looked into this quickly. Not very simple to achieve.

Assuming you currently use yii\rbac\DbManager, you would need to extend this class. It should be noted this class is not a model, but instead uses insert/delete sql commands directly, so you would need to implement models for each of the tables that it uses.

rafaelwithoeft commented 8 years ago

Hello @zainalawaludin It is being discussed an improvement for RBAC, so it uses ActiveRecord classes and consequently ActiveQuery, which I believe can resolve this issue.

https://github.com/yiisoft/yii2/issues/570 https://github.com/yiisoft/yii2/pull/6872

Best Regards