Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 270
  • Last Modified:

access list table

Hi,

one table called user master.

columns are:
ID
username
password

how do we normally design a access list table for web base application?

there will be 3 type of user:
stardard
super
admin

Please kindly assist in designing the access list table (we are using asp.net to build the application)

Thanks.

0
EdwardPeter
Asked:
EdwardPeter
  • 3
  • 3
2 Solutions
 
Saqib KhanSenior DeveloperCommented:
Users

columns are:
ID
username
password


Access List Table

UID
stardard
super
admin


Primary on ID on user Table and Foreign Key on UID on Access List Table.
0
 
EdwardPeterAuthor Commented:
adilkhan,

are we going to have 4 columns on the access list table?

how are we going to use it to determine which access right ?

Thanks.
0
 
Saqib KhanSenior DeveloperCommented:
Sorry for confusion, on Access Level Table only 2 Columns,

UID
Level

in Level you will specify what level it is, standars, super or admin.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
obahatCommented:
I would use a different approach that would scale better:

User master table remains as is, with the addition of a bit vector column of type int.
ID
UserName
Password
UserPropertyVector.

Each bit in UserProprertyVector stands for a property-
Bit0 would be set to 1 for standard, 0 if user is not standard.
Bit1 - same for super.
Bit2 - same for admin.

This way you can add additional properties for each user by assigning other bits.
You can then determine (following the example above) if a user is (say) standard by

SELECT ID
FROM [User Master]
WHERE UserPropertyVector & 1 > 0

To my experience, this is by far the best way to scale and maintain this kind of properties.
0
 
EdwardPeterAuthor Commented:
obahat,

UserPropertyVector
0 for standard
1 for super
2 for admin
...we can add additional for future access list correct?  or i didn't get the approach?

i'm kinda lost on the bit# and what is & 1 >0 ?

Thanks.
0
 
EdwardPeterAuthor Commented:
obahat,

basically the access list will be used to identify which type of user inorder to know which hyperlink to enable on the web application. please include the logic for future access list level,

i.e.
semi-admin

Thanks.
0
 
Saqib KhanSenior DeveloperCommented:
obahat  approach is also great.

just add an column with datatype BIT and assign values to it

if 0 Then Regular
1 then standard
2 then Admin

so in web Aspp


Select Level from user_Table where UID = xxx

so read the Level value and enable/disable it accordingly.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now