diff --git a/samples/WebApplicationSample/CasbinConfigs/basic_policy.csv b/samples/WebApplicationSample/CasbinConfigs/basic_policy.csv index e8d07b7..b726eaf 100644 --- a/samples/WebApplicationSample/CasbinConfigs/basic_policy.csv +++ b/samples/WebApplicationSample/CasbinConfigs/basic_policy.csv @@ -1,4 +1,4 @@ -# Policy below will only match using the BasicRequestTransformer +# Policy below will only match if using the BasicRequestTransformer p, alice@example.com, BasicTest, Get # Policy below will only match if using the KeyMatchRequestTransformer diff --git a/samples/WebApplicationSample/Startup.cs b/samples/WebApplicationSample/Startup.cs index cf21f62..d45650b 100644 --- a/samples/WebApplicationSample/Startup.cs +++ b/samples/WebApplicationSample/Startup.cs @@ -41,10 +41,6 @@ public void ConfigureServices(IServiceCollection services) options.PreferSubClaimType = ClaimTypes.Name; options.DefaultModelPath = Path.Combine("CasbinConfigs", "basic_model.conf"); options.DefaultPolicyPath = Path.Combine("CasbinConfigs", "basic_policy.csv"); - - // Comment line below to use the default BasicRequestTransformer - // Note: Commenting the line means that the action methods MUST have [CasbinAuthorize()] attribute which explicitly specifies obj and policy. Otherwise authorization will be denied - options.DefaultRequestTransformerType = typeof(KeyMatchRequestTransformer); }); } diff --git a/samples/WebApplicationSample/Views/Home/Index.cshtml b/samples/WebApplicationSample/Views/Home/Index.cshtml index 9346082..38f5715 100644 --- a/samples/WebApplicationSample/Views/Home/Index.cshtml +++ b/samples/WebApplicationSample/Views/Home/Index.cshtml @@ -4,6 +4,6 @@
Basic Model : Policy is "p, alice@example.com, BasicTest, GET" - Basic Test.
-Attrib Route : Policy is "p, alice@example.com, /Attribute, GET" - Attribute Test.
+Basic Transformer: Policy is "p, alice@example.com, BasicTest, Get" - Basic Test.
+KeyMatch Transformer: Policy is "p, alice@example.com, /Attribute, GET" - Attribute Test.
Learn about building Web apps with ASP.NET Core.
-Basic Model : Policy is "p, alice@example.com, BasicTest, GET" - Test.
-Attrib Route : Policy is "p, alice@example.com, /attribtest, GET" - Attribute Route Test.
+Basic Transformer: Policy is "p, alice@example.com, BasicTest, Get" - Basic Test.
+KeyMatch Transformer: Policy is "p, alice@example.com, /Attribute, GET" - Attribute Test.