944,214 Members | Top Members by Rank

Ad:
Sep 23rd, 2005
0

NT user and group system theory

Expand Post »
[First I have to apologize because I am posting this in two different forums on this site.]

I am building a system to mimic the NT user and group system. It works fine, but because of the way I am
storing and querying the data (from MSSQL), it takes forever! I need to use some advanced theory to speed it up and
was hoping some of you theorists might have some advice.

We have
--User
who has
--User Rights
who belongs to
--User Groups
who have
--User Rights

For example:
--Bob
who has
--Right 1, 2, 5, 11, and 17
who belongs to
--Group A and R
who have
--Group A has
--Rights 3, 8, 11, 16
--Group R has
--Rights 1, 2, 55, 102

Therefore, Bob has these Rights
--1, 2, 3, 5, 8, 11, 16, 17, 55, 102

How can I store this in a database in a manner where I can quickly compare Bob's Rights against
Phil's or Sally's? I need to be able to tell if they are equal, or (and this is VERY important, and the
part that is killing me) if Bob has all of Sally's Rights plus more. ie. Bob can do everything Sally can
do, and more.

Right now I have tables in a database storing this information like
--Accounts (Bob, Phil, Sally)
--Groups (A, B, C, ...R, S, T)
--Account Rights (keyed by the Account ID#)
--Group Rights (keyed by Group ID#)

This means that I have to perform a UNION and compare the results of the UNION.

I am wondering if there might be some sort of data structure that would allow me to
map one users Rights against another users using a SQL query (I have to use only one query because I am filtering
based on the results of the query)?
And give me an answer of:
--equal Rights
--user A has same and more than B
--user A has some, but not all B (ie. a False)
Depending on the data structure, I can of course, change the way I am storing the data in the database.

I was thinking some sort of matrix, hash, or ingenious implementataion of an existing construct (Travelling Salesman, etc).

Serious cudos to anyone who can help me with this. It's driving me crazy at how long it takes to list users in my app.

Thanks!!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
garraeth is offline Offline
5 posts
since Sep 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Computer Science Forum Timeline: CS vs EE, CS Degree and other questions
Next Thread in Computer Science Forum Timeline: NT user and group system theory





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC