Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 1009 Vote(s) - 3.46 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to implement multiple user cms?

#1
I would like to implement a multiple user CMS website, where each user is able to execute CRUD actions on their own records. This means that security should be implemented on record-level, not on model-level.

I've come up with 2 solutions:

1. Have an `owner_id` field in each model.
2. Have a database per user for the models that they modify. Keep a main database for all the related records (such as users' data (name, email, username, password), models that are edited by admins, but not users, etc).

---

Solution 2, I was thinking of implementing with Apache's help. I would have

[To see links please register here]

for user3, for example, where this would be a separate website to the main website at

[To see links please register here]

. I would symlink all the directories apart from `/web/uploads` and `/config`:

- `/config` - I would need for the database configuration for user3
- `/web/uploads` - I would use for their uploads.

---

Is there a best practice/design pattern to implement this with Symfony? I have never developed a website that can dynamically select a database based on the user (solution 2), so am wondering if this makes sense.

I have experience with Symfony 1.x , but haven't done any development on Symfony2 yet.
Reply

#2
I would go with solution 1, have one database for all instances with an owner_id field. It's easier to maintain that way. At some point you may have to make changes to the database and having to do that on multiple databases can become a nightmare unless you automate that somehow.

There's hardly any advantage in doing it in separate databases unless you have some serious security issues to consider.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through