question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Route Level security

See original GitHub issue

Was thinking of something like this.

Thoughts?

this.Get("/", async ctx => await this.RequiresAuthentication(async innerctx => await innerctx.WriteAsync("authed")));

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:32 (18 by maintainers)

github_iconTop GitHub Comments

5reactions
RagingKorecommented, May 24, 2018

that looks more atractive and doable. I would go with full pipeline composition as an alternative.

Here are some examples:

public class PlayersModule : CarterModule {
  public PlayersModule() {
    Route("/players/{:id}")
      .Authorize()
      .Get(ctx => // do something authorized );
 
    Route("/players/{:id}")
      .AuthorizeWithClaims(x => x.Type == "Admin")
      .Post(ctx => // do something authorized );
      
    Route("/players/{:id}")
      .Anonymous()
      .Put(ctx => // do something);
      
    Route("/players/{:id}")
      .Pipe(ctx => // do whatever my heart desires)
      .Delete(ctx => // do something authorized );
  }
}
1reaction
JoeSteadcommented, May 24, 2018

It will require some sort of Carter pipeline intertwined with the ASP.NET one (I don’t think the details of which need to be exposed), so will require a bit more upfront thought, but it avoids specific CarterRequest and CarterResponse objects, whilst taking the extensibility up to 11.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Row-Level Security - SQL Server
Learn how Row-Level Security uses group membership or execution context to control access to rows in a database table in SQL Server.
Read more >
Using row-level security (RLS) with user-based rules to ...
Restrict access to an existing dataset by using row-level security (RLS) with rules based on username or group in Amazon QuickSight.
Read more >
Power BI Row-level Security - Complete Guide - YouTube
It is called Row- level Security and probably one of the greatest ... Exam - My journey, learning materials & what to expect...
Read more >
Securing data lakes with row-level access control
Row-level access control is a simple and performant way to protect data, while giving users access to the data they need to perform...
Read more >
Row Level Security
Using Row Level Security (RLS) enables you to restrict the data a user can see to just what they are allowed to. This...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found