Would be nice if the last video if this playlist would be the video where you explain the difference between different patterns e.g. Flyweight vs Singelton
Could you please guide me for what's the difference Custom Authorization Filter vs Policy in ASP.Net Core I'm got confused It'll be nice if u provide me an article or example for when to use both of them thanks ?
@@RawCoding I watch most of it , but get it's awsome,and I'll compleete it when I have a time , but I'm now confused with what I mentioned if u can clear this confusion for me thanks
@@RawCoding I know that,but in example like this I think I can do what is the custom policy know without creaating requirement and handler so what is the difference or when to use authorize public class ClaimRequirementAttribute : TypeFilterAttribute { public ClaimRequirementAttribute(string claimType, string claimValue) : base(typeof(ClaimRequirementFilter)) { Arguments = new object[] { new Claim(claimType, claimValue) };
} } public class ClaimRequirementFilter : IAuthorizationFilter { readonly Claim _claim; public ClaimRequirementFilter(Claim claim) { _claim = claim; } public void OnAuthorization(AuthorizationFilterContext context) { var hasClaim = context.HttpContext.User.Claims.Any(c => c.Type == _claim.Type && c.Value == _claim.Value); if (!hasClaim) { context.Result = new ForbidResult(); } } [Route("api/resource")] public class MyController : Controller { [ClaimRequirement("Permission", "SCI_FI")] //[StreamingCategoryAuthorize(StreamingCategory.SCI_FI)] [HttpGet] public IActionResult GetResource() { return Ok(); } } }
Universities need to just show this playlist.
Cheers)
Brilliant!
Cheers
The one guy who disliked wanted to test the extrinsic state of the button.
Hahahahaha
Lol!
Would be nice if the last video if this playlist would be the video where you explain the difference between different patterns e.g. Flyweight vs Singelton
I’ll run a poll
Great video. Did anyone else noticed the ass in the background?
🍑
How would you implement Flyweight in a microservices scenario?
Could you please guide me for what's the difference
Custom Authorization Filter vs Policy in ASP.Net Core
I'm got confused
It'll be nice if u provide me an article or example for when to use both of them
thanks ?
I have a whole series on authorisation in aspnetcore
@@RawCoding I watch most of it , but get
it's awsome,and I'll compleete it when I have a time , but I'm now confused with what I mentioned if u can clear this confusion for me thanks
Policy is a business rule
Custom filter is an infrastructure setup
@@RawCoding I know that,but in example like this I think I can do what is the custom policy know without creaating requirement and handler so what is the difference or when to use authorize
public class ClaimRequirementAttribute : TypeFilterAttribute
{
public ClaimRequirementAttribute(string claimType, string claimValue) : base(typeof(ClaimRequirementFilter))
{
Arguments = new object[] { new Claim(claimType, claimValue) };
}
}
public class ClaimRequirementFilter : IAuthorizationFilter
{
readonly Claim _claim;
public ClaimRequirementFilter(Claim claim)
{
_claim = claim;
}
public void OnAuthorization(AuthorizationFilterContext context)
{
var hasClaim = context.HttpContext.User.Claims.Any(c => c.Type == _claim.Type && c.Value == _claim.Value);
if (!hasClaim)
{
context.Result = new ForbidResult();
}
}
[Route("api/resource")]
public class MyController : Controller
{
[ClaimRequirement("Permission", "SCI_FI")]
//[StreamingCategoryAuthorize(StreamingCategory.SCI_FI)]
[HttpGet]
public IActionResult GetResource()
{
return Ok();
}
}
}
👍🏽
Awesome
Hi, Requesting video
The best way to Check a file is virus-infected or not.
No
Can you provide us this code?
Check the description