def remove_admin_access_permissions(apps, schema_editor):
 ContentType = apps.get_model(u'contenttypes.ContentType')
 Permission = apps.get_model(u'auth.Permission')
 wagtailadmin_content_type = ContentType.objects.get(app_label=u'wagtailadmin', model=u'admin')
 Permission.objects.filter(content_type=wagtailadmin_content_type, codename=u'access_admin').delete()

def remove_admin_access_permissions ( apps , schema_editor ) : ContentType = apps . get_model ( u'contenttypes.ContentType' ) Permission = apps . get_model ( u'auth.Permission' ) wagtailadmin_content_type = ContentType . objects . get ( app_label = u'wagtailadmin' , model = u'admin' ) Permission . objects . filter ( content_type = wagtailadmin_content_type , codename = u'access_admin' ) . delete ( )
reverse the above additions of permissions .