<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/sources/codewithmukesh/best-of/2026/06" -->

---
title: Best Code with Mukesh posts — June 2026 | daily.dev
description: The most upvoted Code with Mukesh posts from June 2026, curated by the daily.dev community.
canonical: https://daily.dev/sources/codewithmukesh/best-of/2026/06
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:url: https://daily.dev/sources/codewithmukesh/best-of/2026/06
og:type: website
og:site_name: daily.dev
og:title: Best Code with Mukesh posts — June 2026 | daily.dev
og:description: The most upvoted Code with Mukesh posts from June 2026, curated by the daily.dev community.
og:image: https://media.daily.dev/image/upload/s--VAY5ToZt--/f_auto/v1724209435/public/daily.dev%20-%20open%20graph
---

# Best of Code with Mukesh — June 2026

1. 1  
[](https://daily.dev/posts/role-based-authorization-in-asp-net-core-istqwpszr "Role-Based Authorization in ASP.NET Core")  
Article  
![Avatar of codewithmukesh](https://media.daily.dev/image/upload/s--q1j2l6nv--/f_auto,q_auto/v1780213497/logos/codewithmukesh?_a=BAMAMiWQ0)Code with Mukesh · 12w  
Role-Based Authorization in ASP.NET Core  
A practical guide to implementing role-based authorization (RBAC) in ASP.NET Core .NET 10 Web APIs. Covers how roles travel from the database into JWT claims, how to configure RoleClaimType to avoid the silent 403 bug caused by claim-name mapping, and how to protect Minimal API endpoints using RequireRole. Explains the critical OR vs AND semantics when specifying multiple roles, how to define reusable named policies with AddAuthorizationBuilder, and how to use User.IsInRole() for in-code branching. Also discusses when role-based authorization stops scaling and when to move to claims or policy-based authorization.  
18
2. 2  
[](https://daily.dev/posts/policy-based-authorization-in-asp-net-core-3ynswpeoj "Policy-Based Authorization in ASP.NET Core")  
Article  
![Avatar of codewithmukesh](https://media.daily.dev/image/upload/s--q1j2l6nv--/f_auto,q_auto/v1780213497/logos/codewithmukesh?_a=BAMAMiWQ0)Code with Mukesh · 11w  
Policy-Based Authorization in ASP.NET Core  
Policy-based authorization is the single authorization engine in ASP.NET Core — roles and claims are just shorthand built on top of it. This guide covers the full system on .NET 10: defining policies with AddAuthorizationBuilder, writing custom requirements and handlers with DI support, expressing OR logic via multiple handlers for one requirement, using IAuthorizationRequirementData for parameterized attribute-based rules, securing APIs by default with a fallback policy, and running imperative checks with IAuthorizationService. Key gotchas include handlers executing for anonymous callers (requiring explicit RequireAuthenticatedUser), the AND/OR asymmetry between requirements and handlers, and the need to opt out OpenAPI/Scalar endpoints from the fallback policy.  
11  
1

[See all Code with Mukesh archives](/sources/codewithmukesh/best-of)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@graph":[{"@type":"CollectionPage","@id":"https://daily.dev/sources/codewithmukesh/best-of/2026/06#page","url":"https://daily.dev/sources/codewithmukesh/best-of/2026/06","name":"Best Code with Mukesh Posts — June 2026","description":"The most upvoted Code with Mukesh posts from June 2026, curated by the daily.dev community.","isPartOf":{"@type":"WebSite","url":"https://daily.dev"}},{"@type":"ItemList","@id":"https://daily.dev/sources/codewithmukesh/best-of/2026/06#items","numberOfItems":2,"itemListElement":[{"@type":"ListItem","position":1,"url":"https://daily.dev/posts/role-based-authorization-in-asp-net-core-istqwpszr","name":"Role-Based Authorization in ASP.NET Core"},{"@type":"ListItem","position":2,"url":"https://daily.dev/posts/policy-based-authorization-in-asp-net-core-3ynswpeoj","name":"Policy-Based Authorization in ASP.NET Core"}]},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sources","item":"https://daily.dev/sources"},{"@type":"ListItem","position":3,"name":"Code with Mukesh","item":"https://daily.dev/sources/codewithmukesh"},{"@type":"ListItem","position":4,"name":"Best of","item":"https://daily.dev/sources/codewithmukesh/best-of"},{"@type":"ListItem","position":5,"name":"June 2026"}]}]}
```

