which solution u advising me to use for login system

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • freethinker
    New Member
    • May 2009
    • 17

    which solution u advising me to use for login system

    hi, i don't know if there is a design pattern for this, but this is the case:
    my java application to manage players, coaches, teams and matches.

    only one administrator is allowed to add, change of delete players, teams ..
    and only users with high permission are allowed to add matches or delete them from the database.

    i was thinking about this solution:

    add a new table to my DB: tblusers
    user_id, user, password, privilege level

    Code:
    if (user.getPrivilegeLevel == x){
      // delete, insert, .. 
    }
    but this is a lot of work, to add this control to all classes alle methodes in dataacces layer and business layer, don't u think that?

    thx & kr
    e
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #2
    Well...You can have three tables.
    users{
    user_id (primary_key),
    password,
    user_details ... addresses/contact info ....etc
    };

    programs{
    program_id (primary_key),
    program_details ..if any
    };

    and

    user_accesses{
    program_id (foreign key -> program_id of programs)
    user_id (foreign key -> user_id of users),
    acess_details ... insert(Y/N),update(Y/N)...etc
    };.

    First and last tables are obvious.
    But the middle one ... which program? ;)
    Basically it refers to your pages to be used by the users.
    So by using joining these three tables you can get all the privileges of an user for a particular page/program.

    Comment

    • freethinker
      New Member
      • May 2009
      • 17

      #3
      i'm gonne think about that solution
      thank u

      Comment

      Working...