From 2871c28d7022a682e6677f3191d04cc62f2c6bd2 Mon Sep 17 00:00:00 2001 From: Paul Williams <43178452+paulfwilliams@users.noreply.github.com> Date: Tue, 11 Aug 2020 16:38:25 -0500 Subject: [PATCH] correct spelling of Principle to Principal A "principle" is a guiding idea. The correct usage here is principal as in a chief actor or leader. (See also the ClaimsPrincipal class https://docs.microsoft.com/en-us/dotnet/api/system.security.claims.claimsprincipal?view=netcore-3.1.) --- docs/en/CurrentUser.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/en/CurrentUser.md b/docs/en/CurrentUser.md index e4aca40811..5a400dc098 100644 --- a/docs/en/CurrentUser.md +++ b/docs/en/CurrentUser.md @@ -1,4 +1,4 @@ -# Current User +# Current User It is very common to retrieve the information about the logged in user in a web application. The current user is the active user related to the current request in a web application. @@ -86,7 +86,7 @@ Beside these standard methods, there are some extension methods: ## ICurrentPrincipalAccessor -`ICurrentPrincipalAccessor` is the service that should be used (by the ABP Framework and your application code) whenever the current principle of the current user is needed. +`ICurrentPrincipalAccessor` is the service that should be used (by the ABP Framework and your application code) whenever the current principal of the current user is needed. For a web application, it gets the `User` property of the current `HttpContext`. For a non-web application, it returns the `Thread.CurrentPrincipal`. @@ -114,9 +114,9 @@ public class MyService : ITransientDependency } ```` -### Changing the Current Principle +### Changing the Current Principal -Current principle is not something you want to set or change, except at some advanced scenarios. If you need it, use the `Change` method of the `ICurrentPrincipalAccessor`. It takes a `ClaimsPrinciple` object and makes it "current" for a scope. +Current principal is not something you want to set or change, except at some advanced scenarios. If you need it, use the `Change` method of the `ICurrentPrincipalAccessor`. It takes a `ClaimsPrincipal` object and makes it "current" for a scope. Example: @@ -132,7 +132,7 @@ public class MyAppService : ApplicationService public void Foo() { - var newPrinciple = new ClaimsPrincipal( + var newPrincipal = new ClaimsPrincipal( new ClaimsIdentity( new Claim[] { @@ -143,7 +143,7 @@ public class MyAppService : ApplicationService ) ); - using (_currentPrincipalAccessor.Change(newPrinciple)) + using (_currentPrincipalAccessor.Change(newPrincipal)) { var userName = CurrentUser.UserName; //returns "john" //...