How to implement client admin in Django?

I am creating a simple application, a kind of project / task manager, where I can have several projects and several tasks assigned to one project.

I have included the Django admin for all such tasks, and it works like a charm. In addition, I have some users who have projects assigned to them. So, now I want to enable a shortened version of the administrator for these users, where:

  • They can manage / see tasks only within the framework of their own project.
  • They can only delete their own tasks.
  • some other minor limitations.

What would be the best approach to this? Should I create another application with custom views and pages for client editing tasks, or should I delete another administrator instance and fine-tune it only for them?

I hope this was clear and not too subjective. Thanks.

+4
source share
2 answers

I think the best way to do this, anyway, is to somehow implement row-level permissions.
At the moment, the best solution for this is probably using django-granular-permissions .

Like Dmitry, I am also for my application. Using common ideas, modelforms et cetera is likely to lead to less work than changing the admin application (which is not really done for hacking).

In addition, if you keep an eye on the future, if there is a need for a more complex function / restriction, you will have fewer problems.

+2
source

+1 for a custom application, a hacking administrator can take more time than just creating your own administrator from common views.

+3
source

Source: https://habr.com/ru/post/1299877/


All Articles