@@ -64,7 +64,7 @@ You may assign a role to one or many users.
6464To check if a user has a specified permission, you may check if the user has a role with that permission.
6565
6666Associated with each role or permission, there may be a * rule* .
67- A rule represents a piece of code that access checker
67+ A rule represents a piece of code that an access checker
6868will execute to decide if the corresponding role or permission applies to the current user.
6969For example, the "update post" permission may have a rule that checks if the current user is the post creator.
7070During access checking, if the user is NOT the post creator, there's no "update post" permission.
@@ -99,7 +99,7 @@ return [
9999];
100100```
101101
102- ` \Yiisoft\Rbac\Manager\PhpManager ` uses a PHP script files to store authorization data.
102+ ` \Yiisoft\Rbac\Manager\PhpManager ` uses PHP script files to store authorization data.
103103The files are under ` @rbac ` alias.
104104Make sure the directory and all the files in it are writable by the Web server process if you want to change permission
105105hierarchy online.
@@ -168,7 +168,7 @@ final readonly class RbacCommand extends Command
168168 $updatePost = (new Permission('updatePost'))->withDescription('Update post');
169169 $auth->add($updatePost);
170170
171- // add "author" role and give this role the "createPost" permission
171+ // add the "author" role and give this role the "createPost" permission
172172 $author = new Role('author');
173173 $auth->add($author);
174174 $auth->addChild($author, $createPost);
@@ -230,7 +230,7 @@ class m170124_084304_init_rbac extends Migration
230230 $updatePost = (new Permission('updatePost'))->withDescription('Update post');
231231 $auth->add($updatePost);
232232
233- // add "author" role and give this role the "createPost" permission
233+ // add the "author" role and give this role the "createPost" permission
234234 $author = new Role('author');
235235 $auth->add($author);
236236 $auth->addChild($author, $createPost);
@@ -266,10 +266,10 @@ You could apply migration by using `./yii migrate`.
266266
267267TODO: update when signup implemented in demo / template.
268268
269- The author can create a post, admin can update post and do everything the author can.
269+ The author can create a post, admin can update the post and do everything the author can.
270270
271- If your application allows user signup, you need to assign roles to these new users once.
272- For example, in order for all signed-up users to become authors in your advanced project template you need
271+ If your application allows user signup, you need to assign roles to these new users at once.
272+ For example, in order for all signed-up users to become authors in your advanced project template, you need
273273to change ` frontend\models\SignupForm::signup() ` as follows:
274274
275275``` php
@@ -314,7 +314,7 @@ use Yiisoft\Rbac\Item;
314314use \Yiisoft\Rbac\Rule;
315315
316316/**
317- * Checks if authorID matches user passed via params.
317+ * Checks if the authorID matches user passed via params.
318318 */
319319final readonly class AuthorRule extends Rule
320320{
@@ -360,7 +360,7 @@ Now you've got the following hierarchy:
360360
361361### Access check <span id =" access-check " ></span >
362362
363- The check is done similar to how it was done in the first section of this guide:
363+ The check is done similarly to how it was done in the first section of this guide:
364364
365365``` php
366366namespace App\Blog\Post;
@@ -396,7 +396,7 @@ final readonly class PostController
396396}
397397```
398398
399- The difference is that now checking for user's own post is part of the RBAC.
399+ The difference is that now checking for a user's own post is part of the RBAC.
400400
401401If the current user is Jane with ` ID=1 ` you are starting at ` createPost ` and trying to get to ` Jane ` :
402402
0 commit comments