Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Using DBIC: What is the correct way to design relationships for Role Based Authorization?

by DrHyde (Prior)
on Jun 06, 2012 at 10:46 UTC ( [id://974687]=note: print w/replies, xml ) Need Help??


in reply to Using DBIC: What is the correct way to design relationships for Role Based Authorization?

I suggest designing the database first, including all the foreign key relationships, and only after you've done that should you create your DBIx::Class stuff.

To answer your specific question how to design the relationships for role-based authentication, I suggest three tables:

user
id, username, password_hash, etc ...
role
id, name
user_role
user_id, role_id
I'm sure that the meanings of all these field names and the relationships between them are obvious. If it isn't, then you should first read a book on relational databases.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://974687]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-03-28 08:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found