473,383 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Role Based Security Issue

Hello:

I am a member of a team creating a .NET application, and we seem to have run
into an issue when trying to implement role based security.

Our application makes use of a fairly common (table based) security model in
which privileges are assigned to roles, which are then assigned users. So,
for example, the user "JSmith" may be assigned to a "SalesRep" role and as a
result have "Add Customer", "View Customer", and "Edit Customer" privileges.

Our privileges directly correspond with the CRUD methods of our classes. So,
if a user is attempting to view a customer, the following method would be
called:

public static Customer GetCustomer(Guid CustomerID)
{
// Retrieve role information for current user
RoleInfo roleInfo =
RoleInfo.GetRoleInfo(Thread.CurrentPrincipal.Ident ity.Name);

// Determine if role contains view customer privilege
if(!roleInfo.RolePrivilegeInfoCollection.Includes( "Customer",
"View"))
{
throw new SecurityException("User not authorized to
view a customer");
}

// Retrieve customer record
return (Customer)DataPortal.Fetch(new Criteria(CustomerID));
}

We have managed the security of many classes in this manner, and it has
worked quite well. Recently, however, we encountered a situation in which a
user may need to be granted an object privilege in one context but not in
another. So, continuing with the above example, it may be necessary to allow
a user to view all (or a subset of) customer fields if they appear on Form1
but not if they appear on Form2.

Because privileges correspond directly with object methods, this requirement
is (obviously) problematic - the current design only allows for one
privilege per object method regardless of the number of contexts in which
that object is used. Our dilemma is how to get around this limitation, and
we are considering the following solutions:
1. Create a different version of the customer object for each object
context. A unique set of privileges can then be assigned to each object.
2. Allow a client to pass the current context to a single customer object
when making a request. Security decisions can then be made based upon the
identity of the current user *and* the context in which the object is being
used.
3. Associate privileges with forms or more general tasks rather than entity
methods. Because security would be enforced at a higher level,
Customer.GetCustomer() could be accessed by the system regardless of the
context in which the object is being used.
4. Other options?

Has anyone else run into a similar problem? Rather than trying to "reinvent
the wheel", we would prefer to incorporate a proven pattern that won't get
us into hot water in the long run. I have had trouble finding any
discussion of these issues either on the web or in print and would
appreciate any input or suggestions. Also, any information on sites or books
that discuss these types of issues would be appreciated.

Thanks!

Chris

Jul 21 '05 #1
0 1354

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: php newbie | last post by:
Hello, I am trying to load a simple tab-delimited data file to SQL Server. I created a format file to go with it, since the data file differs from the destination table in number of columns. ...
3
by: craig | last post by:
I am working on my first .NET development project that involves custom role-based security per the project requirements. This lead to a general design issue this week that really caused us some...
4
by: hazz | last post by:
If I successfully run a VS.NET app which includes the following; ************************** APP 1 **************************** m_iIdnt = new...
2
by: Jesper Stocholm | last post by:
I have implemented role-based security within my ASP.Net application. However, it seems the role is not passed to the authentication ticket I create. I want to use it to display/hide some...
0
by: Liet Kynes | last post by:
I'm new to the .NET security framework, and I pose the following questions: 1) According to the documentation I've read .NET is promoting a role-based security model centered around IPrincipal....
9
by: Guadala Harry | last post by:
This inquiry has to do with the client capabilities and Web client experience: I've been developing rich client apps (Windows desktop client exes in n-tier architecture) for over 10 years and am...
3
by: Mike Logan | last post by:
Questions about Role Based Security in ASP.Net: I have a few questions about role based security in an ASP.Net application. Below are some points about our system: - We have a hierarchical...
0
by: ChrisB | last post by:
Hello: I am a member of a team creating a .NET application, and we seem to have run into an issue when trying to implement role based security. Our application makes use of a fairly common...
7
by: nugget | last post by:
Role-based security for an ASP/ASP.NET mixed environment Hello: My co-worker and I have been charged with designing role-based security for our intranet. The technologies we have to work with...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.