Django-Permissions-Keeper
An easy way to keep group permissions in sync between Development and Production environments.
Installation
- Install "pip install permkeep"
- Add permkeep to your installed apps in settings.py.
INSTALLED_APPS = (
...
'permkeep',
...
)
- Define your group permissions in settings.py.
a = Add, c = Change, d = Delete
GROUP_PERMISSIONS = (
{
'name': 'Editor',
'codes': (
('event', 'acd'),
('newsitem','acd'),
('tag','acd'),
('category','ac'),
('peopletag','acd'),
)
},
{
'name': 'Contributor',
'codes': (
('event', 'ac'),
('newsitem','ac'),
('tag','a'),
('peopletag','a'),
)
}
)
- Run "./manage.py setperms"
This will add any groups and permissions that currently don't exist. It does not delete permissions.
You can run the command several times to add permissions in the future. If the permission already exists it will skip over it.