The only way is to define through a the database. 

Define resources and their privileges and those are given yo specific users. Eg a resource like user details can have privileges like, view, add, edit, delete, print, deactivate, etc. A user can be given some or all privileges. This privileges can be extended to include fields available for the user to edit or add input. 

On the UI just check if the privileges are set to true and when conditions are met u display or enable. 

This approach will. Make it easy to manage roles and permissions in respect to resources thatyou need accessed. 




Sent from my Huawei phone


-------- Original message --------
From: Nicholas Odanga <niodanga@gmail.com>
Date: Tue, Nov 30, 2021, 5:59 PM
To: Isaac Kimotho <izakimotho@gmail.com>
Cc: Skunkworks Mailing List <skunkworks@lists.my.co.ke>
Subject: Re: [Skunkworks] User roles definition in .NET
Thanks, Isaac for the reply. 

The client requires that certain users need to be accessed only certain fields so that they can update the data. 
Apart from creating views and assigning access to it. 

Is there any other way?

PS: The application is running on ASP.NET 2 which was introduced in the market in 2005. 





On Tue, Nov 30, 2021 at 4:25 PM Isaac Kimotho <izakimotho@gmail.com> wrote:
Have you CHecked the Role Based Access Control asp.net mvc

check this
  1. https://www.codeproject.com/Articles/875547/Custom-Roles-Based-Access-Control-RBAC-in-ASP-NET
  2. https://www.aspsnippets.com/Articles/Implement-Role-based-Security-in-ASPNet-MVC.aspx
  3. https://newbedev.com/role-based-access-control-rbac-vs-claims-based-access-control-cbac-in-asp-net-mvc

On Tue, Nov 30, 2021 at 10:45 AM Nicholas Odanga via skunkworks <skunkworks@lists.my.co.ke> wrote:
Morning,
A quick question, can I create and define a role in ASP.NET or ASP MVC to do a specific thing?
In this can I want to create a role and assign it to a user to only update to fields in a system. 

Any guidance can be appreciated. I am going round in circles on the internet looking for a solution. 

_______________________________________________
skunkworks mailing list
skunkworks@lists.my.co.ke
------------
List info, subscribe/unsubscribe
https://lists.my.co.ke/mailman/listinfo/skunkworks
------------

Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke


--
Best Regards
=================================
Isaac Kimotho Kanyanja
Software Engineer
 P.O.Box - 35465, 00200 - Nairobi
Cell: +254 724 346 453
Skype:  kimotholefty



--