From 42190a76a0517c1c97d5ff7a4119b47a4a71825a Mon Sep 17 00:00:00 2001 From: Wesley B <62723358+wesleyboar@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:45:28 -0600 Subject: [PATCH] feat: grid editor group and permissions (#896) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: grid editor (⚠️ untested) * fix: grid editor "row" not "rw" * fix: grid editor permission name typos --- .../group_perms/grid_editor_advanced.py | 28 +++++++++++++++++++ .../commands/group_perms/grid_editor_basic.py | 22 +++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 taccsite_cms/management/commands/group_perms/grid_editor_advanced.py create mode 100644 taccsite_cms/management/commands/group_perms/grid_editor_basic.py diff --git a/taccsite_cms/management/commands/group_perms/grid_editor_advanced.py b/taccsite_cms/management/commands/group_perms/grid_editor_advanced.py new file mode 100644 index 000000000..5b3715355 --- /dev/null +++ b/taccsite_cms/management/commands/group_perms/grid_editor_advanced.py @@ -0,0 +1,28 @@ +from django.contrib.auth.models import Group + +from .util import add_perm + +def set_group_perms(): + group, was_created = Group.objects.get_or_create( + name='Grid Editor (Advanced)' + ) + + add_perm(group, 'cms', 'page', 'Can change page') + add_perm(group, 'cms', 'page', 'Can view page') + + add_perm(group, 'cms', 'placeholder', 'Can use Structure mode') + + add_perm(group, 'bootstrap4_grid', 'bootstrap4 grid container', 'Can add bootstrap4 grid container') + add_perm(group, 'bootstrap4_grid', 'bootstrap4 grid container', 'Can change bootstrap4 grid container') + add_perm(group, 'bootstrap4_grid', 'bootstrap4 grid container', 'Can delete bootstrap4 grid container') + add_perm(group, 'bootstrap4_grid', 'bootstrap4 grid container', 'Can view bootstrap4 grid container') + + add_perm(group, 'bootstrap4_grid', 'bootstrap4 grid column', 'Can add bootstrap4 grid column') + add_perm(group, 'bootstrap4_grid', 'bootstrap4 grid column', 'Can change bootstrap4 grid column') + add_perm(group, 'bootstrap4_grid', 'bootstrap4 grid column', 'Can delete bootstrap4 grid column') + add_perm(group, 'bootstrap4_grid', 'bootstrap4 grid column', 'Can view bootstrap4 grid column') + + add_perm(group, 'bootstrap4_grid', 'bootstrap4 grid row', 'Can add bootstrap4 grid row') + add_perm(group, 'bootstrap4_grid', 'bootstrap4 grid row', 'Can change bootstrap4 grid row') + add_perm(group, 'bootstrap4_grid', 'bootstrap4 grid row', 'Can delete bootstrap4 grid row') + add_perm(group, 'bootstrap4_grid', 'bootstrap4 grid row', 'Can view bootstrap4 grid row') diff --git a/taccsite_cms/management/commands/group_perms/grid_editor_basic.py b/taccsite_cms/management/commands/group_perms/grid_editor_basic.py new file mode 100644 index 000000000..e27e69c0b --- /dev/null +++ b/taccsite_cms/management/commands/group_perms/grid_editor_basic.py @@ -0,0 +1,22 @@ +from django.contrib.auth.models import Group + +from .util import add_perm + +def set_group_perms(): + group, was_created = Group.objects.get_or_create( + name='Grid Editor (Basic)' + ) + + add_perm(group, 'cms', 'page', 'Can change page') + add_perm(group, 'cms', 'page', 'Can view page') + + add_perm(group, 'cms', 'placeholder', 'Can use Structure mode') + + add_perm(group, 'bootstrap4_grid', 'bootstrap4 grid container', 'Can change bootstrap4 grid container') + add_perm(group, 'bootstrap4_grid', 'bootstrap4 grid container', 'Can view bootstrap4 grid container') + + add_perm(group, 'bootstrap4_grid', 'bootstrap4 grid column', 'Can change bootstrap4 grid column') + add_perm(group, 'bootstrap4_grid', 'bootstrap4 grid column', 'Can view bootstrap4 grid column') + + add_perm(group, 'bootstrap4_grid', 'bootstrap4 grid row', 'Can change bootstrap4 grid row') + add_perm(group, 'bootstrap4_grid', 'bootstrap4 grid row', 'Can view bootstrap4 grid row')