diff --git a/corputils/migrations/0002_migrate_permissions.py b/corputils/migrations/0002_migrate_permissions.py index e4a3f852..ba2c74bd 100644 --- a/corputils/migrations/0002_migrate_permissions.py +++ b/corputils/migrations/0002_migrate_permissions.py @@ -13,9 +13,9 @@ PERMISSIONS = { 'corp_apis': 'Can view API keys of members of their corporation.', 'alliance_apis': 'Can view API keys of members of their alliance.', 'blue_apis': 'Can view API keys of members of blue corporations.', - 'view_corp_corpstats': 'Can view_corp corpstats', - 'view_alliance_corpstats': 'Can view_alliance corpstats', - 'view_blue_corpstats': 'Can view_blue corpstats', + 'view_corp_corpstats': 'Can view corp stats of their corporation.', + 'view_alliance_corpstats': 'Can view corp stats of members of their alliance.', + 'view_blue_corpstats': 'Can view corp stats of blue corporations.', } } @@ -30,7 +30,7 @@ def user_permissions_dict(apps): return { 'user': {x: Permission.objects.get_or_create(name=x, codename=x, content_type=user_ct)[0] for x in PERMISSIONS['user']}, - 'corpstats': {x: Permission.objects.get_or_create(codename=x, content_type=corpstats_ct)[0] for x, y in PERMISSIONS['corpstats'].items()}, + 'corpstats': {x: Permission.objects.get_or_create(codename=x, name=y, content_type=corpstats_ct)[0] for x, y in PERMISSIONS['corpstats'].items()}, } def users_with_permission(apps, perm): diff --git a/corputils/models.py b/corputils/models.py index c00089e3..1e99d310 100644 --- a/corputils/models.py +++ b/corputils/models.py @@ -26,14 +26,9 @@ class CorpStats(models.Model): ('corp_apis', 'Can view API keys of members of their corporation.'), ('alliance_apis', 'Can view API keys of members of their alliance.'), ('blue_apis', 'Can view API keys of members of blue corporations.'), - ) - default_permissions = ( - 'add', - 'change', - 'remove', - 'view_corp', - 'view_alliance', - 'view_blue', + ('view_corp_corpstats', 'Can view corp stats of their corporation.'), + ('view_alliance_corpstats', 'Can view corp stats of members of their alliance.'), + ('view_blue_corpstats', 'Can view corp stats of blue corporations.'), ) verbose_name = "corp stats" verbose_name_plural = "corp stats"