Results 1 to 4 of 4
  1. #1
    Join Date
    May 2013
    Posts
    3

    Role Permission tables for group

    Hi
    I'm new in database designing. What I intend to do is that I allow users of my website to form groups and groups have admins and admins can define permission levels(each permission level belongs to its own group and groups do not share permissions). then role table assigns permissions to users. now I'm not sure which way shows permission ownership and user-permission relation better.

    I have two ideas, hope you can help me chose one or modify them.
    I guess design 2 looks easier for query but I'm not sure if its complexity and efficiency is ok or not.

    Thanks
    Attached Thumbnails Attached Thumbnails jcJEO.png   A6hny.png  

  2. #2
    Join Date
    May 2013
    Posts
    3
    I guess, the best way is to remove role table and set up the permissionLevel for each user in groupMembership table.

  3. #3
    Join Date
    Feb 2012
    Posts
    76
    Unfortunately, neither diagram corresponds to your written description, and the description isn't clear enough for me to understand your requirements. I suggest you write out what you want in the following form:

    Each user belongs to 1 group
    Each group contains 1 or more users.

    Each permission level belongs to one group.
    Each group has 1 or more permission levels.

    You have to write each relationship in both directions. You can even do the same for the attributes - beginners often impose their own assumptions about how the world is structured onto their database designs, but intuition usually isn't the best design guide.

    What these sentences do is to analyze your requirements in the form of binary relations, and from the cardinalities ("each", "0 or 1", "exactly 1", "1 or more", "0 or more") one can work out the tables and relationships without much difficulty.

    I checked a few online resources and liked the look of this one, I hope it helps: Introduction to database design

  4. #4
    Join Date
    May 2013
    Posts
    3
    thanks, really helpful

Posting Permissions

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