Critique My Auth System DB Schema?
I'm designing a RESTful Web app that will provide an authentication system for several other apps. The other apps will query this app through HTTP and get back XML describing authenticated users.
The authentication app needs to keep track of which users are allowed to do what on which applications.
I'm working out the DB schema. Below is my initial design. (Assume each table has an
applications # The various client apps that will query this auth system. ------------ name users # Table simplified for discussion ----- username password email roles ----- name application_id roles_users ----------- role_id user_id
The idea is say someone tried to perform an administrative function in the the "Equipment Inventory" app. So "Equipment Inventory" would say to the auth system "get the user with username xxx and password yyy." Then it would look at the returned (via ActiveResource)
User object and check whether its
roles Array contains a
Role with a name of "ADMIN" that itself belongs to an
Application object with a name of "Equipment Inventory".
Or perhaps it would be better to eliminate the
applications table and have many more roles, e.g., "
What's more important, normalizing the Application entity or simplifying the table structure? Perhaps after all that typing I've just answered my own question, but comments or suggestions would be most welcome.
The schema looks sane, You would send
and you get back
- → "failed to open stream" error when executing "migrate:make"
- → I can't do a foreign key, constraint error
- → Setting a default value on settings form return null in Octobercms
- → Eloquent Multitable query
- → "Laravel 5.1" add user and project with userId
- → Image does not go in database with file name only tmp name saved?
- → Database backup with custom code in laravel 5 and get the data upto 10 rows from per table in database
- → Trait 'IlluminateFoundationBusDispatchesJobs' not found
- → Setting the maxlength of text in an element that is displayed
- → laravel check between 2 integer from database
- → how to retrieve image from database in laravel 5.1?
- → relationship for database Column type object
- → Carousel in Laravel 4 does not show as expected