Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2007
    Location
    010101010110100
    Posts
    803

    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 Attached Thumbnails export1.jpg   export2.jpg  

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2007
    Location
    010101010110100
    Posts
    803
    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.

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Mar 2007
    Location
    010101010110100
    Posts
    803
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •