If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Storing object specific permissions in a normalized DB

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-04-04, 13:43
nohappyend nohappyend is offline
Registered User
 
Join Date: Feb 2004
Posts: 1
Question Storing object specific permissions in a normalized DB

Hi

I need to store permissions for a RBAC system in a database and now I want to know the best way to do so and not giving up normalization.

I have different data types in my model like Article, Folder etc. Each one is stored in its own table:

Code:
Article := (id, folder, title, ...)
Folder := (id, folder, title, ...)
Each object (data type instance) has multiple permissions assigned to itself. In a RBAC system, permissions consist of an action, the object the permission is for and a role (let's say roles are stored in their own table for now and all roles are stored in one table).

The simplest way to store permissions would be in a central table:

Code:
Permission := (datatype, object_id, action, role)
Where an example entry could be ('article', 12, 'edit', 2). However, this seems pretty unclean to me because I'd store the table name of the datatype to operate on in the datatype attribute.

Another way was to have a permission table for each data type. This way the information about the referenced data type would be stored in the table to chose from when checking permissions:

Code:
ArticlePermission := (article_id, action, role)
FolderPermission := (article_id, action, role)
This would also allow for extending the permissions where you also need parameters to the action (like "add" action with the parameter "article" and "folder" for adding the article to a folder).


Now, another problem arises: There are not only global roles, but there may also be roles depending on the referenced article's properties (like an Owner role for the creating user). If I did not store these roles in the global table but in a data type specific table, the <data type>Permission tables would not be sufficient. I would need <data type>LocalPermissions and <data type>GlobalPermissions.

Or am I completely wrong?

nohappyend
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On