I am using Ruby on Rails, but I think this question could be applied to any database design. I am trying to develop my own permissions system.
Is it poor design to have an array of what a user can edit? i.e. a User has a column of can_edit with a value of [Articles, Events, Costs] or a User can_view with a value of [All].
And then I can just run a check on what is being edited. Or is this poor design?
In general, your database design ought to be properly normalized. That would mean that you shouldn’t store multiple values in a single row. You’ll likely be much better served by a design that has three tables
Permissionhas columnspermission_idandpermission_typeand lists the valid permissionsUserhas auser_idcolumn and lists the value usersUser_Permissionis a mapping table between the two. It has columnspermission_idanduser_idboth of which are defined as foreign keys to thePermissionandUsertables respectively