@@ -67,7 +67,7 @@ Create a file migration class
6767 --templateFile='@vendor/dmstr/yii2-db/db/mysql/templates/file-migration.php' init_dump
6868```
6969
70- ### dmstr\console\controllers\MysqlControllers
70+ ### [ dmstr\console\controllers] ( https://github.com/dmstr/yii2-db/blob/master/console/controllers )
7171
7272Include it in your console configuration
7373
@@ -104,6 +104,59 @@ SUB-COMMANDS
104104- db/index (default) Displays tables in database
105105```
106106
107+ Traits
108+ ---
109+
110+ ### [ dmstr\db\traits\ActiveRecordAccessTrait] ( https://github.com/dmstr/yii2-db/blob/master/db/traits/ActiveRecordAccessTrait.php )
111+
112+ How to equip your active record model with access control
113+
114+ - Use update migration in ` db/migrations/m160609_090908_add_access_columns `
115+
116+ - set all ` $tableNames ` to be updated and run migration
117+
118+ This migrations adds the available access check columns to your database table(s)
119+
120+ ```
121+ 'access_owner',
122+ 'access_read',
123+ 'access_update',
124+ 'access_delete',
125+ 'access_domain',
126+ ```
127+
128+ - Add ` use \dmstr\db\traits\ActiveRecordAccessTrait; ` to your active record model
129+
130+ - * (update your cruds)*
131+
132+
133+ ** :secret : Congrats, you are now ready to manage specific access checks on your active records!**
134+
135+ :bulb : Access options:
136+
137+ - All access option -> {* }
138+ - specific rbac roles and permissions assignable
139+ - single or multi
140+ - ` {*} `
141+ - ` {Role1},{Role2},{Permission1},... `
142+
143+ - limit access to specific domains / languages
144+ - single or multi
145+ - ` {*} `
146+ - ` {de},{en},{fr},... `
147+
148+ - ` Owner ` access overrides other given permissions
149+ - every active rocord can have exact one owner!
150+
151+ Planned updates:
152+ ---
153+
154+ - ActiveRecordAccessTrait
155+ - in cruds use select2 multi for inputs (domain, read, update, delete)
156+ - Setter: authItemArrayToString()
157+ - Getter: authItemStringToArray()
158+
159+
107160---
108161
109162Built by [ dmstr] ( http://diemeisterei.de )
0 commit comments