106 Security: Server Side Authorization. WebApi services. - chempkovsky/CS82ANGULAR GitHub Wiki

Two aspects

Security has two aspects: Authentication and Authorization

Steps required to accomplish the task

  • In the article 105 we imported the definitions of the Views.
    • The Import Action copies not only the View settings but WebApi service as well
  • Note: In all the cases before current article we did apply DefaultWebApiService.Core.cs.t4 or DefaultWebApiServiceWithMassTransit.Core.cs.t4 scripts to generate the code. For some Views in this article will apply other t4-scrips.
    • Please, pay special attention to the t4-script which will be used for the Security Views
  • For all the security views the following steps will be the same
    • right click Controllers-folder of the PhBkControllers.csproj-project and run WebApi services Wizard
    • on the first page
      • click Next-button
    • on the second page
      • select PhBkContext.csproj-project
      • select aspnetchckdbcontext-DbContext
      • click Next-button

aspnetmodelView

  • on the third page the setting must be as follows
    • click Next-button
Click to show the picture

project structure

  • on the fourth page
    • select DefaultWebApiService.Core.cs.t4-script
    • click Next-button
  • on the fifth page
    • click Save-button
    • click Next-button

aspnetroleView

  • on the third page the setting must be as follows
    • click Next-button
Click to show the picture

project structure

  • on the fourth page
    • select WebApiAspNetRoleService.cs.t4-script
    • click Next-button
  • on the fifth page
    • click Save-button
    • click Next-button

aspnetrolemaskView

  • on the third page the setting must be as follows
    • click Next-button
Click to show the picture

project structure

  • on the fourth page
    • select DefaultWebApiService.Core.cs.t4-script
    • click Next-button
  • on the fifth page
    • click Save-button
    • click Next-button

aspnetuserView

  • on the third page the setting must be as follows
    • click Next-button
Click to show the picture

project structure

  • on the fourth page
    • select WebApiAspNetUserService.cs.t4-script
    • click Next-button
  • on the fifth page
    • click Save-button
    • click Next-button

aspnetusermaskView

  • on the third page the setting must be as follows
    • click Next-button
Click to show the picture

project structure

  • on the fourth page
    • select WebApiAspNetUserMasksService.cs.t4-script
    • click Next-button
  • on the fifth page
    • click Save-button
    • click Next-button

aspnetuserpermsView

  • on the third page the setting must be as follows
    • click Next-button
Click to show the picture

project structure

  • on the fourth page
    • select WebApiAspNetUserPermsService.cs.t4-script
    • click Next-button
  • on the fifth page
    • click Save-button
    • click Next-button

aspnetuserrolesView

  • on the third page the setting must be as follows
    • click Next-button
Click to show the picture

project structure

  • on the fourth page
    • select WebApiAspNetUserRolesService.cs.t4-script
    • click Next-button
  • on the fifth page
    • click Save-button
    • click Next-button
⚠️ **GitHub.com Fallback** ⚠️