Maintenance will be performed on,,, and on Tuesday 26 May 2020 starting at approximately 10am CDT. It is expected to take around 30 minutes and will involve a short period of downtime, around 5 minutes, towards the end of the maintenance period. Please address any questions, comments, or concerns to

Commit 120c0617 authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB

ligoauth: create authgroup for grb managers

Users in this group have permission to "T90", or update certain
parameters of GrbEvents in GraceDB
parent 695d3d25
# -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-08-09 18:21
from __future__ import unicode_literals
from django.db import migrations
'name': 'grb_managers',
'description': ('LIGO/Virgo members in the GRB subgroup who have '
'permission to update external GRB events in GraceDB'),
def create_authgroup(apps, schema_editor):
AuthGroup = apps.get_model('ligoauth', 'AuthGroup')
Permission = apps.get_model('auth', 'Permission')
# Create AuthGroup
ag = AuthGroup.objects.create(**AUTHGROUP_INFO)
# Get permissions for "T90"-ing a grbevent
perm = Permission.objects.get(
# *IMPORTANT*: clear all current users who have this
# permission. It should only be assigned to groups
# going forward.
# Add this permission to the new AuthGroup
def delete_authgroup(apps, schema_editor):
AuthGroup = apps.get_model('ligoauth', 'AuthGroup')
# Delete AuthGroup
ag = AuthGroup.objects.get(name=AUTHGROUP_INFO['name'])
class Migration(migrations.Migration):
dependencies = [
('ligoauth', '0049_update_access_managers_membership'),
operations = [
migrations.RunPython(create_authgroup, delete_authgroup),
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-08-08 18:27
from __future__ import unicode_literals
from django.db import migrations
GROUP_NAME = 'grb_managers'
def add_users(apps, schema_editor):
AuthGroup = apps.get_model('ligoauth', 'AuthGroup')
User = apps.get_model('auth', 'User')
group = AuthGroup.objects.get(name=GROUP_NAME)
for username in USERS:
user, _ = User.objects.get_or_create(username=username)
class Migration(migrations.Migration):
dependencies = [
('ligoauth', '0050_create_grb_managers_authgroup'),
operations = [
migrations.RunPython(add_users, migrations.RunPython.noop),
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment