Django permissions According to branch ID

Viewed 201

I have permissions according to branch_id.

For example if I have two branches with ids 1 and 2. Also,add,change,view and delete the permissions in every models will be: add_model_name_1,add_model_name_2,change_model_name_1,change_model_name_2 and so on

So at increase the branches the performance will be slower and slower.

What the best solution for this dilemma. Can I copy authentications apps from Django library to my projects and make foreign key from branch models in permissions models. If I take this in considerations. May I will lose the future update for Django, base to that I need to customize other library that depends on Django permissions likes Django guardian. What about indexes , Could it solve a problems. if it could, How can I make index for Django permissions model. the answer to this question return us to customize Django permissions.

who is agree with me to make issues for this dilemma. Also who have another solution.

1 Answers

If you are operating many operations at the same time in all branches then it will obviously be slower , for the permission , you can customize as per your need check the doc here !

And don't worry about loosing it in further django updates , those basic structures won't be changed or removed completely may be enhanced in future .

Hope it will help .

Related