3

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.

Ivan Kharlamov
  • 1,889
  • 2
  • 24
  • 33
TIMEX
  • 259,804
  • 351
  • 777
  • 1,080

2 Answers2

3

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.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
  • But the link you provided (http://docs.djangoproject.com/en/dev/topics/auth/#permissions) only matter with model. I want to set permissions like: "this user can edit scores of other users. This user can create badges." These examples are not permissions that tie in with a model. – TIMEX Jan 24 '11 at 21:32
  • 2
    So? Just because the permissions are created at the same time as a model doesn't mean they can only be used with a model. There's also probably another way to create permissions, maybe with a fixture or the like. – Ignacio Vazquez-Abrams Jan 24 '11 at 21:41
0

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

azibi
  • 4,027
  • 1
  • 14
  • 17