104 Security: Server Side Authorization. Entities and DbContext. - chempkovsky/CS82ANGULAR GitHub Wiki
Security has two aspects: Authentication and Authorization
- In the article 103 we mentioned permission storage.
- Except that, we need the User interface for managing user data. To generate the Typescript classes we need the View declarations.
- Again, we can define Views only after declaring Entities and DBContext.
- Thus, before creating views, we need a temporary explicit declaration of some entities defined by Microsoft
IdentityDbContext
. After generating the Views we must delete temporary entities. - Another aspect is permission storage entities. Some of permission storage entities must reference
role
-entity to persist (permission bitmask, role) pairs.
- Except that, we need the User interface for managing user data. To generate the Typescript classes we need the View declarations.
- As a result, we need to generate Entities and DBContext twice.
- first time, for modeling
- second time, for production
- In this article we will show how to generate Entities and DBContext for modeling.
- Next time, after creating the code for the Views, we will regenerate the Entities and DBContext for production.
- right click
Auth
-folder of thePhBkEntity.csproj
-project- select
JavaScript Wizard
-menu item
- select
- click
Next
-button on the first page
- Select
PhbkContext
-project andPhbkDbContext
-context and clickNext
-button
Click to show the picture
- Select
==Context==
and clickNext
-button
Click to show the picture
- Click
Batch processing
-button-
Batch Actions
-dialog will be shown
-
Click to show the picture
- select
00040-AspNetEntitiesDev.json
- batch script and click start- four files will be created
- close dialog and close the Wizard
Click to show the picture
- right click
Auth
-folder of thePhBkContext.csproj
-project- select
JavaScript Wizard
-menu item
- select
- click
Next
-button on the first page
- Select
PhbkContext
-project andPhbkDbContext
-context and clickNext
-button
Click to show the picture
- Select
==Context==
and clickNext
-button
Click to show the picture
- Click
Batch processing
-button-
Batch Actions
-dialog will be shown
-
Click to show the picture
- select
00050-AspNetDbContextDev.json
- batch script and click start- four files will be created
- close dialog and close the Wizard