❔ Implementing security from a web library

We're coding a web library to generate a html CRUD at runtime from a metadata, after a lot of effort the project is getting cool, but now we need to implement security rules for the routes: Ex: in the DataDictionary area, where the metadata are configured only admin could access, and the MasterData Area would be access to the CRUD Form where logged users would access. What would be the best strategy to setup this scenario? Repo: https://github.com/JJConsulting/JJMasterData I've been implemented it by adding policy to the routes, but I thought it was too difficult to configure https://jjconsulting.tech/docs/JJMasterData/articles/authorization.html Any suggestion will be welcome. 😇
GitHub
GitHub - JJConsulting/JJMasterData: .NET CRUD library with Bootstra...
.NET CRUD library with Bootstrap support to create Forms at runtime from a data dictionary. - GitHub - JJConsulting/JJMasterData: .NET CRUD library with Bootstrap support to create Forms at runtime...
5 Replies
Anton
Anton15mo ago
if (routeData.Values.ContainsKey("area"))
area = routeData.Values["area"]!.
if (routeData.Values.ContainsKey("area"))
area = routeData.Values["area"]!.
use TryGetValue
if ("MasterData".ToLower().Equals(area?.ToLower()))
{
if ("MasterData".ToLower().Equals(area?.ToLower()))
{
use string.Equals with StringComparison.InvariantCultureIgnoreCase, for example also, you've missed an else statement in the example else if ("DataDictionary" the policy thing seems optimal
Lucio Pelinson
Lucio Pelinson15mo ago
tks @AntonC, but I'm still in doubt if deploying security along the route is a good idea, and if this is good practice.
Anton
Anton15mo ago
I don't see why it would be bad
Lucio Pelinson
Lucio Pelinson15mo ago
Ok. Thank you for your opinion. Let's keep going like this.
Accord
Accord15mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts
❔ Avalonia ComboBox SelectedValuePath```xml <ComboBox SelectedValue="{Binding Path=SomeValue, Mode=TwoWay}" SelectedValuePath="Tag"> ✅ ef core can't translate a queryquery: ```cs var username = "some username"; var user = await _db.Users .FirstOrDefault❔ Is the functionality of my code in the right placeI created a valueobject for my sitemap. I'm wondering if it's in the right place or shouldn't it be ❔ Microsoft SQL Server Management Studio ("authority that is not trusted")I'm trying to connect my local server from SSMS but there's an error after I connect.❔ ✅ Trying to understand HID device response dataI have a wireless mouse that I'm trying to make my own software for. So far, it has been quite straiIssue with FolderBrowserDialog in console applicationHey, when I start my application via Visual Studio everything works, but as soon as I start the cons❔ How to restart a BackgroundServiceSearching the internets, I seem to be finding answers that don't really seem right, and not good eve❔ Whats the difference between classes and public classes?Tried looking at Microsoft docs earlier but the don't really answer the question. I already know wh❔ Questions on validating columns and types (updating a single column in a table via REST API)I'm new to .NET and C#. I'm trying to implement a somewhat more difficult endpoint where the user pr❔ Trying to save location data using JSON. Need help!I am very new to coding, and I need to make 3 different scripts (or one script with all 3 functions)