Models:
Company
Product
We have a parent company (the owner of all), which can create any Companyand any Product, like a sub-company or a sub-product.
Now, what I would like to do is limit which company can CRUD other companies and products.
Here are the scenarios:
Company and sub-companies (subcontractors):
Master (creates) -> Company "A"
Master (creates) -> Company "B" (creates) -> Company "C"
Master (creates) -> Company "D" (creates) -> Company "F" (creates) -> Company "G"
Purpose of the company and product:
Master (Add Product) -> Show all products
Master (assign products to top levels) -> Company "A", Company "B" and Company "D"
Product purpose for the company (management):
Company "B" (assign products only to sub-level) -> Company "C"
Company "D" (assign products only to sub-level) -> Company "F"
Company "F" (assign products only to sub-level) -> Company "G"
However, if you Company Dremove a product from a sub-level, it will also be recursively removed from all products of the sub-level.
- Django , , , ? Django Model Meta options Options.permissions... , .