﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6121	Need ability to identify permissions and group by name	jdetaeye	nobody	"
User permissions are stored as integer numbers in the database and in fixtures files. The integers are auto-generated based on the defined models and user-defined permissions.[[BR]]

For instance, a json fixture to define a group looks like this:[[BR]]

[
[{""pk"": 1, ""model"": ""auth.group"", ""fields"": {""name"": ""mygroup"", ""permissions"": [22, 23, 24, 25, 26, 27, 28, 29, 30, 31]}}
]

The problem with this setup is that the numbers change with any model change in the applications, and therefore invalidate all existing group fixtures. [[BR]]
This makes it inpractical to define or maintain predefined group definitions, and also makes it harder to re-use django applications across projects.


Ideally, the fixtures store the permissions as a string, which is translated into the internal numbering used by django during the load. [[BR]]
Having the ability to define groups in the models.py or admin.py would also be helpful.

(Ticket #6020 describes another situation where identifying a group by a string comes in handy)"		closed	Core (Serialization)	dev		duplicate	permissions fixtures		Design decision needed	0	0	0	0	0	0
