❔ 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
use TryGetValue
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 optimaltks @AntonC, but I'm still in doubt if deploying security along the route is a good idea, and if this is good practice.
I don't see why it would be bad
Ok. Thank you for your opinion. Let's keep going like this.
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.