Remove activate_userkey permission

This commit is contained in:
Jeremy Stretch
2020-06-02 09:47:31 -04:00
parent 110bad7041
commit c6e85970d4
5 changed files with 9 additions and 6 deletions

View File

@@ -23,7 +23,7 @@ class UserKeyAdmin(admin.ModelAdmin):
actions = super().get_actions(request)
if 'delete_selected' in actions:
del actions['delete_selected']
if not request.user.has_perm('secrets.activate_userkey'):
if not request.user.has_perm('secrets.change_userkey'):
del actions['activate_selected']
return actions

View File

@@ -56,7 +56,6 @@ class Migration(migrations.Migration):
],
options={
'ordering': ['user__username'],
'permissions': (('activate_userkey', 'Can activate user keys for decryption'),),
},
),
migrations.AddField(

View File

@@ -64,9 +64,6 @@ class UserKey(models.Model):
class Meta:
ordering = ['user__username']
permissions = (
('activate_userkey', "Can activate user keys for decryption"),
)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)