If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Am I missing a relationship here?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-08-07, 05:20
Frunkie Frunkie is offline
Gives Bad Advice
 
Join Date: Mar 2007
Location: 010101010110100
Posts: 791
Am I missing a relationship here?

Hello all,

I have 4 tables that deal with access to various pages in a UI. What I am shooting for is to be able to set up different groups and then assign users and pages to that group.

I am including 2 pics. I have currently chosen to use the pic labeled export2.jpg but as I am going through the database entering sample data I am seeing that there is a better way to model this.

To answer the question as to what page is paired to a certain user, could I use a sub query for this as in export1?

Can someone please advise which model is better to use?
Attached Thumbnails
Am I missing a relationship here?-export1.jpg   Am I missing a relationship here?-export2.jpg  
Reply With Quote
  #2 (permalink)  
Old 10-08-07, 06:05
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
the one on the right is wrong

maybe it's just me, with my pre-conceived notions of what groups are for, but i would design the model so that a user doesn't necessarily have to belong to a group in order to have access to a page

in my mind, groups can exist to make administration of users easier, but you should not have to "create" a dummy group for a unique user just in order to grant permissions

and the whole question of "permissions" is tricky, because it easily gets confused with database permissions (i.e. users having access to database views and tables and so on)
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 10-08-07, 06:28
Frunkie Frunkie is offline
Gives Bad Advice
 
Join Date: Mar 2007
Location: 010101010110100
Posts: 791
Quote:
Originally Posted by r937
i would design the model so that a user doesn't necessarily have to belong to a group in order to have access to a page

in my mind, groups can exist to make administration of users easier, but you should not have to "create" a dummy group for a unique user just in order to grant permissions
I agree. Let me clarify then so I make sure that I understand.

The permissions themselves are on the individual pages. If I use the model on the left, and page "x" was not in the proper group, a dummy group would need to be created to suite that person's page access as you suggested.

Would you put the permissions on the pages themselves?

This is very confusing to me because I am thinking in terms of UNIX permissions and it is clouding my ability to correctly model this.

Should I just get rid of the group completely?

Thanks for helping Rudy.
Reply With Quote
  #4 (permalink)  
Old 10-08-07, 06:34
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by fjm1967
Should I just get rid of the group completely?
that's a great idea

just model the users and the pages, and then when that's all done, you can think about adding groups back in
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 10-08-07, 06:51
Frunkie Frunkie is offline
Gives Bad Advice
 
Join Date: Mar 2007
Location: 010101010110100
Posts: 791
Quote:
Originally Posted by r937
that's a great idea

just model the users and the pages, and then when that's all done, you can think about adding groups back in
Thanks Rudy.. I'll do that.. It makes more sense anyway.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On