What database structure should I use for a process (business rules) that is dynamic?

3

When we are developing software, we often come across this question: "Is software forged by processes or processes are forged by sofwtare? Or both?"

Case Study -

Work in a company where business rules are not so well established, or are very flexible and change at all times. At least 3 times a year. We have about 14 usertypes in our business rules, but because of flexibility usertype3, for example, that had some privileges to access system pages and specific parts of those pages, can suddenly assume the privileges of usertype8 and have access to pages he could not previously access. The worst case scenario is when you change that user's permission for a given page but that page needed information from previous pages that he did not access or access.

The software was developed about 5 years ago and during that time, all the patches were made in a chaotic way in the system, so that today the different users with their specifics are registered among the about 800 pages of php code. It has reached the point of unsustainability where maintenance is becoming unfeasible, and gambiarras are everywhere, and also in the database.

So this year's priority is to restructure the system and yesterday the discussion was about the database. What should be the ideal model to support this flexibility of business rules?

The basic requirement of the project manager is that it has to be a template that supports endless usertypes and needs minimal maintenance.

Template - 1

Well, with this rule where there are no established rules I was a little lost and I question the operability of such a system. But I did some research and put together a template that might solve the problem of accessing infinite pages by infinite types of users. This model is self explanatory. The word adm that you place in each table is just to mark up system administration tables. The object tables refer to objects within the page. Objects that present content and behavior based on previously or defined criteria. The tblcontacts table is where the system users are, data with login, password etc.

Template - 2

The fact is that my model was not accepted by the group. The template that was accepted is a table (only one table - tblAccessLevel ) where the columns are the possible system pages and the lines all users of the system. There will be no more usertypes and yes access levels. The levels can be from 0 to infinity . So far we have about 20,000 users and 800 pages. That is, TODAY would be a table of 20,000 X 800 (to date). For example, each user will have level-0, for page-1 or level-7 for page-50, etc ..., where level 0 is unauthorized user.

I found this solution strange, but I do not rule out the possibility of being the correct one, so I wanted to hear from the group what you think and according to each one's experience, how would the system maintenance be based on the second idea. And I also wanted to see critiques of my model - 1 solution. I also wanted to know if there is any model that is already used in the market with the same idea.

    
asked by anonymous 18.08.2016 / 16:40

0 answers