Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

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, 06:20
Frunkie Frunkie is offline
Gives Bad Advice
 
Join Date: Mar 2007
Location: 010101010110100
Posts: 706
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-relationship-here-export1.jpg  am-i-missing-relationship-here-export2.jpg  
__________________
I and many others around the world are of the strong belief that the universe was created by the Flying Spaghetti Monster. It was He who created all that we see and all that we feel. We feel strongly that the overwhelming scientific evidence pointing towards evolutionary processes is nothing but a coincidence, put in place by Him.
Reply With Quote
  #2 (permalink)  
Old 10-08-07, 07:05
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,556
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

pre-order my book Simply SQL from Amazon
Reply With Quote
  #3 (permalink)  
Old 10-08-07, 07:28
Frunkie Frunkie is offline
Gives Bad Advice
 
Join Date: Mar 2007
Location: 010101010110100
Posts: 706
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.
__________________
I and many others around the world are of the strong belief that the universe was created by the Flying Spaghetti Monster. It was He who created all that we see and all that we feel. We feel strongly that the overwhelming scientific evidence pointing towards evolutionary processes is nothing but a coincidence, put in place by Him.
Reply With Quote
  #4 (permalink)  
Old 10-08-07, 07:34
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,556
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

pre-order my book Simply SQL from Amazon
Reply With Quote
  #5 (permalink)  
Old 10-08-07, 07:51
Frunkie Frunkie is offline
Gives Bad Advice
 
Join Date: Mar 2007
Location: 010101010110100
Posts: 706
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.
__________________
I and many others around the world are of the strong belief that the universe was created by the Flying Spaghetti Monster. It was He who created all that we see and all that we feel. We feel strongly that the overwhelming scientific evidence pointing towards evolutionary processes is nothing but a coincidence, put in place by Him.
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

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