From 75ddc6636eef77670166497b16c5b987ae49df7f Mon Sep 17 00:00:00 2001 From: Andy Stark <30621568+therealandeeee@users.noreply.github.com> Date: Thu, 9 Nov 2017 11:02:53 +0000 Subject: [PATCH] [ADF-1586] Added auth guard docs (#2624) --- docs/README.md | 16 +++++++++--- docs/auth-guard-bpm.service.md | 43 ++++++++++++++++++++++++++++++++ docs/auth-guard-ecm.service.md | 43 ++++++++++++++++++++++++++++++++ docs/auth-guard.service.md | 44 +++++++++++++++++++++++++++++++++ docs/document-list.component.md | 1 - docs/seeAlsoGraph.json | 3 +++ 6 files changed, 145 insertions(+), 5 deletions(-) create mode 100644 docs/auth-guard-bpm.service.md create mode 100644 docs/auth-guard-ecm.service.md create mode 100644 docs/auth-guard.service.md diff --git a/docs/README.md b/docs/README.md index 13e1644e27..483c3c04de 100644 --- a/docs/README.md +++ b/docs/README.md @@ -112,8 +112,8 @@ for more information about installing and using the source code. - [Form rendering service](form-rendering.service.md) - [Form service](form.service.md) +- [Node service](node.service.md) - [*Activiti alfresco service](../ng2-components/ng2-activiti-form/src/services/activiti-alfresco.service.ts) -- [*Node service](../ng2-components/ng2-activiti-form/src/services/node.service.ts) - [*Process content service](../ng2-components/ng2-activiti-form/src/services/process-content.service.ts) - [*Widget visibility service](../ng2-components/ng2-activiti-form/src/services/widget-visibility.service.ts) @@ -278,6 +278,9 @@ for more information about installing and using the source code. - [Alfresco api service](alfresco-api.service.md) - [App config service](app-config.service.md) - [Apps process service](apps-process.service.md) +- [Auth guard bpm service](auth-guard-bpm.service.md) +- [Auth guard ecm service](auth-guard-ecm.service.md) +- [Auth guard service](auth-guard.service.md) - [Authentication service](authentication.service.md) - [Card view update service](card-view-update.service.md) - [Comment process service](comment-process.service.md) @@ -299,9 +302,6 @@ for more information about installing and using the source code. - [Upload service](upload.service.md) - [User preferences service](user-preferences.service.md) - [*Alfresco content service](../ng2-components/ng2-alfresco-core/src/services/alfresco-content.service.ts) -- [*Auth guard bpm service](../ng2-components/ng2-alfresco-core/src/services/auth-guard-bpm.service.ts) -- [*Auth guard ecm service](../ng2-components/ng2-alfresco-core/src/services/auth-guard-ecm.service.ts) -- [*Auth guard service](../ng2-components/ng2-alfresco-core/src/services/auth-guard.service.ts) - [*Content service](../ng2-components/ng2-alfresco-core/src/services/content.service.ts) - [*Favorites api service](../ng2-components/ng2-alfresco-core/src/services/favorites-api.service.ts) - [*Search api service](../ng2-components/ng2-alfresco-core/src/services/search-api.service.ts) @@ -326,6 +326,10 @@ for more information about installing and using the source code. - [*Date cell component](../ng2-components/ng2-alfresco-datatable/src/components/datatable/date-cell.component.ts) - [*Filesize cell component](../ng2-components/ng2-alfresco-datatable/src/components/datatable/filesize-cell.component.ts) - [*Location cell component](../ng2-components/ng2-alfresco-datatable/src/components/datatable/location-cell.component.ts) + +### Directives + +- [*No permission template directive](../ng2-components/ng2-alfresco-datatable/src/directives/no-permission-template.directive.ts) ### Other classes and interfaces @@ -353,6 +357,10 @@ for more information about installing and using the source code. - [*Content node selector component](../ng2-components/ng2-alfresco-documentlist/src/components/content-node-selector/content-node-selector.component.ts) - [*Version upload component](../ng2-components/ng2-alfresco-documentlist/src/components/version-manager/version-upload.component.ts) +### Directives + +- [*No permission content directive](../ng2-components/ng2-alfresco-documentlist/src/components/no-permission/no-permission-content.directive.ts) + ### Models - [Document library model](document-library.model.md) diff --git a/docs/auth-guard-bpm.service.md b/docs/auth-guard-bpm.service.md new file mode 100644 index 0000000000..e60e94cc6c --- /dev/null +++ b/docs/auth-guard-bpm.service.md @@ -0,0 +1,43 @@ +# Auth Guard Bpm service + +Adds authentication with Process Services to a route within the app. + +## Details + +The Auth Guard Bpm service implements an Angular +[route guard](https://angular.io/guide/router#milestone-5-route-guards) +to check the user is logged into Process Services. This is typically used with the +`canActivate` guard check in the route definition: + +```ts +const appRoutes: Routes = [ + ... + { + path: 'examplepath', + component: ExampleComponent, + canActivate: [ AuthGuardBpm ] // <- Requires authentication for this route. + }, + ... +] +``` + +If the user now clicks on a link or button that follows this route, they will be prompted +to log in before proceeding. + +This service only accepts authentication with APS but you can use the +[Auth Guard Ecm service](auth-guard-ecm.service.md) to authenticate +against ACS or the [Auth Guard service](auth-guard.service.md) to authenticate against +either ACS or APS. See the +[ADF custom page tutorial](https://community.alfresco.com/docs/DOC-6628-adf-105-creating-custom-pages-and-components) +for worked examples of all three guards. + + + +## See also + +- [Auth guard ecm service](auth-guard-ecm.service.md) +- [Auth guard service](auth-guard.service.md) + + + + diff --git a/docs/auth-guard-ecm.service.md b/docs/auth-guard-ecm.service.md new file mode 100644 index 0000000000..213867218e --- /dev/null +++ b/docs/auth-guard-ecm.service.md @@ -0,0 +1,43 @@ +# Auth Guard Ecm service + +Adds authentication with Content Services to a route within the app. + +## Details + +The Auth Guard Bpm service implements an Angular +[route guard](https://angular.io/guide/router#milestone-5-route-guards) +to check the user is logged into Process Services. This is typically used with the +`canActivate` guard check in the route definition: + +```ts +const appRoutes: Routes = [ + ... + { + path: 'examplepath', + component: ExampleComponent, + canActivate: [ AuthGuardBpm ] // <- Requires authentication for this route. + }, + ... +] +``` + +If the user now clicks on a link or button that follows this route, they will be prompted +to log in before proceeding. + +This service only accepts authentication with ACS but you can use the +[Auth Guard Bpm service](auth-guard-bpm.service.md) to authenticate +against APS or the [Auth Guard service](auth-guard.service.md) to authenticate against +either APS or ACS. See the +[ADF custom page tutorial](https://community.alfresco.com/docs/DOC-6628-adf-105-creating-custom-pages-and-components) +for worked examples of all three guards. + + + +## See also + +- [Auth guard service](auth-guard.service.md) +- [Auth guard bpm service](auth-guard-bpm.service.md) + + + + diff --git a/docs/auth-guard.service.md b/docs/auth-guard.service.md new file mode 100644 index 0000000000..ea6a49a8e2 --- /dev/null +++ b/docs/auth-guard.service.md @@ -0,0 +1,44 @@ +# Auth Guard service + +Adds authentication to a route within the app. + +## Details + +The Auth Guard service implements an Angular +[route guard](https://angular.io/guide/router#milestone-5-route-guards) +to check the user is logged in. This is typically used with the +`canActivate` guard check in the route definition: + +```ts +const appRoutes: Routes = [ + ... + { + path: 'examplepath', + component: ExampleComponent, + canActivate: [ AuthGuard ] // <- Requires authentication for this route. + }, + ... +] +``` + +If the user now clicks on a link or button that follows this route, they will be prompted +to log in before proceeding. + +This service will accept authentication with either APS or ACS as valid and is thus suitable for +menu pages and other content that doesn't make use of APS or ACS features. Use the +[Auth Guard Bpm service](auth-guard-bpm.service.md) and +[Auth Guard Ecm service](auth-guard-ecm.service.md) to authenticate +against APS or ACS, respectively. See the +[ADF custom page tutorial](https://community.alfresco.com/docs/DOC-6628-adf-105-creating-custom-pages-and-components) +for worked examples of all three guards. + + + +## See also + +- [Auth guard bpm service](auth-guard-bpm.service.md) +- [Auth guard ecm service](auth-guard-ecm.service.md) + + + + diff --git a/docs/document-list.component.md b/docs/document-list.component.md index c096534101..e2e98a45fe 100644 --- a/docs/document-list.component.md +++ b/docs/document-list.component.md @@ -756,7 +756,6 @@ That will give the following output: ![Custom no permission](docassets/images/no-permission-custom.png) - ## See also - [Datatable component](datatable.component.md) diff --git a/docs/seeAlsoGraph.json b/docs/seeAlsoGraph.json index e228092c34..98bad6fb65 100644 --- a/docs/seeAlsoGraph.json +++ b/docs/seeAlsoGraph.json @@ -9,6 +9,9 @@ "app-config.service": [], "apps-list.component": [], "apps-process.service": ["filter.model"], + "auth-guard.service": ["auth-guard-bpm.service", "auth-guard-ecm.service"], + "auth-guard-bpm.service": ["auth-guard-ecm.service"], + "auth-guard-ecm.service": [], "authentication.service": [], "breadcrumb.component": ["document-list.component"], "bpm-user.model": ["bpm-user.service", "ecm-user.model", "people-process.service"],