From 03a8085431a3a0dbdfcecada8d0d58b7869021b3 Mon Sep 17 00:00:00 2001 From: 0xflotus <0xflotus@gmail.com> Date: Thu, 13 Jun 2019 18:53:00 +0200 Subject: [PATCH] fix(docs): fixed small errors (#1574) --- docs/articles/auth/guard.md | 4 ++-- docs/articles/auth/token.md | 2 +- docs/articles/security/acl-configuration.md | 4 ++-- docs/articles/security/install.md | 2 ++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/articles/auth/guard.md b/docs/articles/auth/guard.md index 9c40770cbd..44560baeed 100644 --- a/docs/articles/auth/guard.md +++ b/docs/articles/auth/guard.md @@ -40,7 +40,7 @@ export class AuthGuard implements CanActivate { } canActivate() { - return this.authService.isAuthenticated(); // canActive can return Observable, which is exactly what isAuhenticated returns + return this.authService.isAuthenticated(); // canActive can return Observable, which is exactly what isAuthenticated returns } } ``` @@ -125,7 +125,7 @@ export class AuthGuard implements CanActivate { } } ``` -*So we just check the the value returened by isAuthenticated and simply redirect to the login page.* +*So we just check the the value returned by isAuthenticated and simply redirect to the login page.* Easy as that! Hope you found it useful.
diff --git a/docs/articles/auth/token.md b/docs/articles/auth/token.md index 82c6304fd1..1c09759a5d 100644 --- a/docs/articles/auth/token.md +++ b/docs/articles/auth/token.md @@ -124,7 +124,7 @@ export class HeaderComponent { .subscribe((token: NbAuthJWTToken) => { if (token.isValid()) { - this.user = token.getPayload(); // here we receive a payload from the token and assigne it to our `user` variable + this.user = token.getPayload(); // here we receive a payload from the token and assigns it to our `user` variable } }); diff --git a/docs/articles/security/acl-configuration.md b/docs/articles/security/acl-configuration.md index ca6811d07f..a178965cf4 100644 --- a/docs/articles/security/acl-configuration.md +++ b/docs/articles/security/acl-configuration.md @@ -41,7 +41,7 @@ Now, let's convert this into an ACL configuration object which Nebular can under ``` As you can see the configuration is pretty much straightforward, each role can have a list of permissions (view, create, remove) and resources that are allowed for those permissions. We can also specify a `*` resource, -which means that we have a permission againts any resource (like moderators can remove both news and comments). +which means that we have a permission against any resource (like moderators can remove both news and comments).
## Role Configuration @@ -141,7 +141,7 @@ export class RoleProvider implements NbRoleProvider { } ``` -So we subscribe to the `tokenChange` observable, which will produce a new token each time authentication change occurres. +So we subscribe to the `tokenChange` observable, which will produce a new token each time authentication change occurs. Then we simply get a role from a token (for example simplicity, we assume that token payload always has a role value) or return default `guest` value. Don't worry if your setup does not use Nebular Auth. You can adjust this code to retrieve a user role from any service of your own. diff --git a/docs/articles/security/install.md b/docs/articles/security/install.md index 6cdab2126d..f4cb429ebe 100644 --- a/docs/articles/security/install.md +++ b/docs/articles/security/install.md @@ -14,12 +14,14 @@ First, let's install the module as it's distributed as an npm package. Security npm i @nebular/security@next ```
+ ## Import the module: ```ts import { NbSecurityModule } from '@nebular/security'; ```
+ ## Register it Now, let's register the module in the root module: