Skip to content

Commit 40d5b91

Browse files
lonnieezellMGatner
andauthored
Apply suggestions from code review
Co-authored-by: MGatner <mgatner@icloud.com>
1 parent 416de4b commit 40d5b91

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

docs/2 - quickstart.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Quick Start Guide
22

3-
Learning any new authentication system can, especially as the get more flexible and sophisticated. This guide is intended to provide short examples for common actions you'll take when working Shield. It is not intended to be the exhaustive documentation for each section. That's better handled through the area-specific doc files.
3+
Learning any new authentication system can be difficult, especially as they get more flexible and sophisticated. This guide is intended to provide short examples for common actions you'll take when working with Shield. It is not intended to be the exhaustive documentation for each section. That's better handled through the area-specific doc files.
44

55
NOTE: The examples assume that you have run the setup script and that you have copies of the `Auth` and `AuthGroups` config files in your application's `app/Config` folder.
66

@@ -16,7 +16,7 @@ public array $redirects = [
1616
];
1717
```
1818

19-
NOTE: This redirect happens after the specified action is complete. In the case of register or login, it might not happen immediately. For example, if you have any Auth Actions specified, they will be redirected when those actions are completed successfully. If no Auth Actions are specified, they will be redirect immediately after registration or login.
19+
NOTE: This redirect happens after the specified action is complete. In the case of register or login, it might not happen immediately. For example, if you have any Auth Actions specified, they will be redirected when those actions are completed successfully. If no Auth Actions are specified, they will be redirected immediately after registration or login.
2020

2121
### Customize login redirect
2222

@@ -61,7 +61,7 @@ public function logoutRedirect(): string
6161

6262
### Customize Remember-me functionality
6363

64-
Remember-me functionality is enabled by default for the `Session` handler. While this is handled in a secure manner, some sites may want it disbled. You might also want to change how long it remberers a user and doesn't require additional login.
64+
Remember-me functionality is enabled by default for the `Session` handler. While this is handled in a secure manner, some sites may want it disabled. You might also want to change how long it remembers a user and doesn't require additional login.
6565

6666
```php
6767
public array $sessionConfig = [
@@ -74,7 +74,7 @@ public array $sessionConfig = [
7474

7575
### Change Access Token Lifetime
7676

77-
By default, Access Tokens can be used for 1 year since they last use. This can be easily modified in the `Auth` config file.
77+
By default, Access Tokens can be used for 1 year since the last use. This can be easily modified in the `Auth` config file.
7878

7979
```php
8080
public int $unusedTokenLifetime = YEAR;
@@ -93,7 +93,7 @@ public array $actions = [
9393

9494
### Enable Account Activation via Email
9595

96-
By deafult, once a user registers they have an active account that can be used. You enable Shield's built-in email-based activation flow within the `Auth` config file.
96+
By default, once a user registers they have an active account that can be used. You can enable Shield's built-in, email-based activation flow within the `Auth` config file.
9797

9898
```php
9999
public array $actions = [
@@ -127,7 +127,7 @@ When a user registers on your site, they are assigned the group specified at `Co
127127

128128
### Change Available Permissions
129129

130-
The permissions on the site are store in the `AuthGroups` config file, also. Each one is defined by a string that represents a context and a permission, joined with a decimal point.
130+
The permissions on the site are stored in the `AuthGroups` config file also. Each one is defined by a string that represents a context and a permission, joined with a decimal point.
131131

132132
```php
133133
public array $permissions = [
@@ -159,7 +159,7 @@ public array $matrix = [
159159

160160
### Assign Permissions to a User
161161

162-
Permissions can also be assigned directly to a user, irregardless of what groups they are a part of. This is done programatically on the `User` Entity.
162+
Permissions can also be assigned directly to a user, regardless of what groups they belong to. This is done programatically on the `User` Entity.
163163

164164
```php
165165
$user = auth()->user();
@@ -177,23 +177,23 @@ $user->syncPermissions(['users.create', 'beta.access']);
177177

178178
## Check If a User Has Permission
179179

180-
When you need to check if a user has a specific permission, you want to check both within the groups they are a part of, as well as any specifically assigned to them, you should use the `can()` method on the `User` entity.
180+
When you need to check if a user has a specific permission use the `can()` method on the `User` entity. This method checks permissions within the groups they belong to and permissions directly assigned to the user.
181181

182182
```php
183183
if (! auth()->user()->can('users.create')) {
184184
return redirect()->back()->with('error', 'You do not have permissions to access that page.');
185185
}
186186
```
187187

188-
This can also be done through a [controller filter](https://codeigniter.com/user_guide/incoming/filters.html) if you want to apply it to multiple pages of your site.
188+
Note: The example above can also be done through a [controller filter](https://codeigniter.com/user_guide/incoming/filters.html) if you want to apply it to multiple pages of your site.
189189

190190

191191

192192

193193

194194
## Managing Users
195195

196-
Since Shield uses a more complex user setup than many other systems, due to the [User Identities](1-concepts.md#identities), this quick overview should help you feel more confident when working with users on a day-to-day basis.
196+
Shield uses a more complex user setup than many other systems, separating [User Identities](1-concepts.md#identities) from the user accounts themselves. This quick overview should help you feel more confident when working with users on a day-to-day basis.
197197

198198
### Creating Users
199199

@@ -227,11 +227,11 @@ $users->delete($user->id);
227227

228228
### Editing A User
229229

230-
The `UserModel::save()` method has been modified to ensure that an email or password previously set on the `User` entity will be automatically in the correct `UserIdentity` record.
230+
The `UserModel::save()` method has been modified to ensure that an email or password previously set on the `User` entity will be automatically updated in the correct `UserIdentity` record.
231231

232232
```php
233233
$users = model('UserModel');
234-
$user = $users->findById(123);
234+
$user = $users->findById(123);
235235

236236
$user->fill([
237237
'username' => 'JoeSmith111',
@@ -241,7 +241,7 @@ $user->fill([
241241
$users->save($user);
242242
```
243243

244-
If you prefer to user the `update()` method, than you will have to update the user's appropriate UserIdentity manually.
244+
If you prefer to use the `update()` method then you will have to update the user's appropriate UserIdentity manually.
245245

246246
```php
247247
$users = model('UserModel');
@@ -254,7 +254,7 @@ $user->fill([
254254
]);
255255

256256
// Saves the username field
257-
$users->save($user);
257+
$users->update($user);
258258
// Updates the email and password
259259
$user->saveEmailIdentity();
260260
```

0 commit comments

Comments
 (0)