AbpSession extension and abpabpsession
The permission management of Abp is based on Identity, and all extensions are also based on claims. Claims has many default attributes and specific connections
For details about Identity, refer to yuanyou blog
After inheriting the UserManager of Microsoft. AspNet. Identity, we directly call await base. CreateIdentityAsync (user, authenticationType). This method completes logon and can be obtained after logon.
HttpContext. Current. User. You can use HttpContext to obtain information about the initialized Claims.
ClaimsPrincipal principal = HttpContext.Current.User as ClaimsPrincipal;if (null != principal){ foreach (Claim claim in principal.Claims) { Response.Write("CLAIM TYPE: " + claim.Type + "; CLAIM VALUE: " + claim.Value + "</br>"); }}
After learning about the basic functions, You can scale them as needed,
Define ClaimsType
/// <Summary> DataPermissions </summary>
Public const string DataPermissions = "http://www.aspnetboilerplate.com/identity/claims/dataPermissions ";
Obtain Claims
View Code
After logon, add Claims identity. AddClaim (new Claim (AbpClaimTypes. DataPermissions, value to be added ));
Get the DataPermissions of the AbpSession