سؤال

I know that Django has a permission/group system. But that's mostly tied to each model. (Correct me if I'm wrong.)

My purpose is to have groups that can do multiple stuff. For example, one group can write to this and that. One group can edit this and that in different servers, different databases. Basically, it's beyond the model system.

I just want a custom groups system that's not tied to any model.

هل كانت مفيدة؟

المحلول

Three permissions are generated per model by default, but you can define additional permissions that you can use for other purposes. From there, the permissions decorator can handle authorization.

نصائح أخرى

You need an app like django-guardian or something to handle object-level permissions, not model.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top