Maintenance will be performed on,,, and tomorrow, 2020/08/04, starting at approximately 9am PDT. It is expected to take around 15 minutes and there will be a short period of downtime towards the end of the maintenance window. Please direct any comments, questions 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
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment