-
Notifications
You must be signed in to change notification settings - Fork 406
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
478 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
default_app_config = "environments.permissions.apps.EnvironmentPermissionsConfig" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from django.apps import AppConfig | ||
from core.apps import BaseAppConfig | ||
|
||
|
||
class EnvironmentPermissionsConfig(AppConfig): | ||
class EnvironmentPermissionsConfig(BaseAppConfig): | ||
default = True | ||
name = "environments.permissions" | ||
label = "environment_permissions" |
127 changes: 127 additions & 0 deletions
127
api/environments/permissions/migrations/0008_historicalpermissions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
# Generated by Django 3.2.20 on 2023-10-18 18:57 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import simple_history.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('users', '0035_historicalffadminuser_historicaluserpermissiongroup'), | ||
('api_keys', '0003_masterapikey_is_admin'), | ||
('permissions', '0009_move_view_audit_log_permission'), | ||
('environments', '0033_history_upgrade'), | ||
('environment_permissions', '0007_add_unique_permission_constraint'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='HistoricalUserEnvironmentPermission', | ||
fields=[ | ||
('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), | ||
('deleted_at', models.DateTimeField(blank=True, db_index=True, default=None, editable=False, null=True)), | ||
('admin', models.BooleanField(default=False)), | ||
('history_id', models.AutoField(primary_key=True, serialize=False)), | ||
('history_date', models.DateTimeField(db_index=True)), | ||
('history_change_reason', models.CharField(max_length=100, null=True)), | ||
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), | ||
('environment', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', related_query_name='userpermission', to='environments.environment')), | ||
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), | ||
('master_api_key', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='api_keys.masterapikey')), | ||
('user', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), | ||
], | ||
options={ | ||
'verbose_name': 'historical user environment permission', | ||
'verbose_name_plural': 'historical user environment permissions', | ||
'ordering': ('-history_date', '-history_id'), | ||
'get_latest_by': ('history_date', 'history_id'), | ||
}, | ||
bases=(simple_history.models.HistoricalChanges, models.Model), | ||
), | ||
migrations.CreateModel( | ||
name='HistoricalUserPermissionGroupEnvironmentPermission', | ||
fields=[ | ||
('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), | ||
('deleted_at', models.DateTimeField(blank=True, db_index=True, default=None, editable=False, null=True)), | ||
('admin', models.BooleanField(default=False)), | ||
('history_id', models.AutoField(primary_key=True, serialize=False)), | ||
('history_date', models.DateTimeField(db_index=True)), | ||
('history_change_reason', models.CharField(max_length=100, null=True)), | ||
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), | ||
('environment', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', related_query_name='grouppermission', to='environments.environment')), | ||
('group', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='users.userpermissiongroup')), | ||
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), | ||
('master_api_key', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='api_keys.masterapikey')), | ||
], | ||
options={ | ||
'verbose_name': 'historical user permission group environment permission', | ||
'verbose_name_plural': 'historical user permission group environment permissions', | ||
'ordering': ('-history_date', '-history_id'), | ||
'get_latest_by': ('history_date', 'history_id'), | ||
}, | ||
bases=(simple_history.models.HistoricalChanges, models.Model), | ||
), | ||
migrations.AddField( | ||
model_name='userenvironmentpermission', | ||
name='deleted_at', | ||
field=models.DateTimeField(blank=True, db_index=True, default=None, editable=False, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='userpermissiongroupenvironmentpermission', | ||
name='deleted_at', | ||
field=models.DateTimeField(blank=True, db_index=True, default=None, editable=False, null=True), | ||
), | ||
migrations.CreateModel( | ||
name='HistoricalUserPermissionGroupEnvironmentPermission_permissions', | ||
fields=[ | ||
('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), | ||
('m2m_history_id', models.AutoField(primary_key=True, serialize=False)), | ||
('history', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, to='environment_permissions.historicaluserpermissiongroupenvironmentpermission')), | ||
('permissionmodel', models.ForeignKey(blank=True, db_constraint=False, db_tablespace='', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='permissions.permissionmodel')), | ||
('userpermissiongroupenvironmentpermission', models.ForeignKey(blank=True, db_constraint=False, db_tablespace='', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='environment_permissions.userpermissiongroupenvironmentpermission')), | ||
], | ||
options={ | ||
'verbose_name': 'HistoricalUserPermissionGroupEnvironmentPermission_permissions', | ||
}, | ||
bases=(simple_history.models.HistoricalChanges, models.Model), | ||
), | ||
migrations.CreateModel( | ||
name='HistoricalUserEnvironmentPermission_permissions', | ||
fields=[ | ||
('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), | ||
('m2m_history_id', models.AutoField(primary_key=True, serialize=False)), | ||
('history', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, to='environment_permissions.historicaluserenvironmentpermission')), | ||
('permissionmodel', models.ForeignKey(blank=True, db_constraint=False, db_tablespace='', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='permissions.permissionmodel')), | ||
('userenvironmentpermission', models.ForeignKey(blank=True, db_constraint=False, db_tablespace='', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='environment_permissions.userenvironmentpermission')), | ||
], | ||
options={ | ||
'verbose_name': 'HistoricalUserEnvironmentPermission_permissions', | ||
}, | ||
bases=(simple_history.models.HistoricalChanges, models.Model), | ||
), | ||
migrations.CreateModel( | ||
name='HistoricalEnvironmentPermissionModel', | ||
fields=[ | ||
('deleted_at', models.DateTimeField(blank=True, db_index=True, default=None, editable=False, null=True)), | ||
('key', models.CharField(db_index=True, max_length=100)), | ||
('description', models.TextField()), | ||
('type', models.CharField(choices=[('PROJECT', 'Project'), ('ENVIRONMENT', 'Environment'), ('ORGANISATION', 'Organisation')], max_length=100, null=True)), | ||
('history_id', models.AutoField(primary_key=True, serialize=False)), | ||
('history_date', models.DateTimeField(db_index=True)), | ||
('history_change_reason', models.CharField(max_length=100, null=True)), | ||
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), | ||
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), | ||
('master_api_key', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='api_keys.masterapikey')), | ||
], | ||
options={ | ||
'verbose_name': 'historical environment permission model', | ||
'verbose_name_plural': 'historical environment permission models', | ||
'ordering': ('-history_date', '-history_id'), | ||
'get_latest_by': ('history_date', 'history_id'), | ||
}, | ||
bases=(simple_history.models.HistoricalChanges, models.Model), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
default_app_config = "organisations.permissions.apps.OrganisationPermissionsConfig" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from django.apps import AppConfig | ||
from core.apps import BaseAppConfig | ||
|
||
|
||
class OrganisationPermissionsConfig(AppConfig): | ||
class OrganisationPermissionsConfig(BaseAppConfig): | ||
default = True | ||
name = "organisations.permissions" | ||
label = "organisation_permissions" |
125 changes: 125 additions & 0 deletions
125
api/organisations/permissions/migrations/0005_historicalpermissions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
# Generated by Django 3.2.20 on 2023-10-18 18:57 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import simple_history.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('users', '0035_historicalffadminuser_historicaluserpermissiongroup'), | ||
('organisations', '0046_allow_allowed_projects_to_be_null'), | ||
('api_keys', '0003_masterapikey_is_admin'), | ||
('permissions', '0009_move_view_audit_log_permission'), | ||
('organisation_permissions', '0004_add_unique_permission_constraint'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='HistoricalUserOrganisationPermission', | ||
fields=[ | ||
('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), | ||
('deleted_at', models.DateTimeField(blank=True, db_index=True, default=None, editable=False, null=True)), | ||
('history_id', models.AutoField(primary_key=True, serialize=False)), | ||
('history_date', models.DateTimeField(db_index=True)), | ||
('history_change_reason', models.CharField(max_length=100, null=True)), | ||
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), | ||
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), | ||
('master_api_key', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='api_keys.masterapikey')), | ||
('organisation', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', related_query_name='userpermission', to='organisations.organisation')), | ||
('user', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)), | ||
], | ||
options={ | ||
'verbose_name': 'historical user organisation permission', | ||
'verbose_name_plural': 'historical user organisation permissions', | ||
'ordering': ('-history_date', '-history_id'), | ||
'get_latest_by': ('history_date', 'history_id'), | ||
}, | ||
bases=(simple_history.models.HistoricalChanges, models.Model), | ||
), | ||
migrations.CreateModel( | ||
name='HistoricalUserPermissionGroupOrganisationPermission', | ||
fields=[ | ||
('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), | ||
('deleted_at', models.DateTimeField(blank=True, db_index=True, default=None, editable=False, null=True)), | ||
('history_id', models.AutoField(primary_key=True, serialize=False)), | ||
('history_date', models.DateTimeField(db_index=True)), | ||
('history_change_reason', models.CharField(max_length=100, null=True)), | ||
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), | ||
('group', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='users.userpermissiongroup')), | ||
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), | ||
('master_api_key', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='api_keys.masterapikey')), | ||
('organisation', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', related_query_name='grouppermission', to='organisations.organisation')), | ||
], | ||
options={ | ||
'verbose_name': 'historical user permission group organisation permission', | ||
'verbose_name_plural': 'historical user permission group organisation permissions', | ||
'ordering': ('-history_date', '-history_id'), | ||
'get_latest_by': ('history_date', 'history_id'), | ||
}, | ||
bases=(simple_history.models.HistoricalChanges, models.Model), | ||
), | ||
migrations.AddField( | ||
model_name='userorganisationpermission', | ||
name='deleted_at', | ||
field=models.DateTimeField(blank=True, db_index=True, default=None, editable=False, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='userpermissiongrouporganisationpermission', | ||
name='deleted_at', | ||
field=models.DateTimeField(blank=True, db_index=True, default=None, editable=False, null=True), | ||
), | ||
migrations.CreateModel( | ||
name='HistoricalUserPermissionGroupOrganisationPermission_permissions', | ||
fields=[ | ||
('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), | ||
('m2m_history_id', models.AutoField(primary_key=True, serialize=False)), | ||
('history', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, to='organisation_permissions.historicaluserpermissiongrouporganisationpermission')), | ||
('permissionmodel', models.ForeignKey(blank=True, db_constraint=False, db_tablespace='', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='permissions.permissionmodel')), | ||
('userpermissiongrouporganisationpermission', models.ForeignKey(blank=True, db_constraint=False, db_tablespace='', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='organisation_permissions.userpermissiongrouporganisationpermission')), | ||
], | ||
options={ | ||
'verbose_name': 'HistoricalUserPermissionGroupOrganisationPermission_permissions', | ||
}, | ||
bases=(simple_history.models.HistoricalChanges, models.Model), | ||
), | ||
migrations.CreateModel( | ||
name='HistoricalUserOrganisationPermission_permissions', | ||
fields=[ | ||
('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), | ||
('m2m_history_id', models.AutoField(primary_key=True, serialize=False)), | ||
('history', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, to='organisation_permissions.historicaluserorganisationpermission')), | ||
('permissionmodel', models.ForeignKey(blank=True, db_constraint=False, db_tablespace='', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='permissions.permissionmodel')), | ||
('userorganisationpermission', models.ForeignKey(blank=True, db_constraint=False, db_tablespace='', null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='organisation_permissions.userorganisationpermission')), | ||
], | ||
options={ | ||
'verbose_name': 'HistoricalUserOrganisationPermission_permissions', | ||
}, | ||
bases=(simple_history.models.HistoricalChanges, models.Model), | ||
), | ||
migrations.CreateModel( | ||
name='HistoricalOrganisationPermissionModel', | ||
fields=[ | ||
('deleted_at', models.DateTimeField(blank=True, db_index=True, default=None, editable=False, null=True)), | ||
('key', models.CharField(db_index=True, max_length=100)), | ||
('description', models.TextField()), | ||
('type', models.CharField(choices=[('PROJECT', 'Project'), ('ENVIRONMENT', 'Environment'), ('ORGANISATION', 'Organisation')], max_length=100, null=True)), | ||
('history_id', models.AutoField(primary_key=True, serialize=False)), | ||
('history_date', models.DateTimeField(db_index=True)), | ||
('history_change_reason', models.CharField(max_length=100, null=True)), | ||
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), | ||
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), | ||
('master_api_key', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='api_keys.masterapikey')), | ||
], | ||
options={ | ||
'verbose_name': 'historical organisation permission model', | ||
'verbose_name_plural': 'historical organisation permission models', | ||
'ordering': ('-history_date', '-history_id'), | ||
'get_latest_by': ('history_date', 'history_id'), | ||
}, | ||
bases=(simple_history.models.HistoricalChanges, models.Model), | ||
), | ||
] |
Oops, something went wrong.