Skip to content

Commit

Permalink
feat: grid editor group and permissions (#896)
Browse files Browse the repository at this point in the history
* feat: grid editor (⚠️ untested)

* fix: grid editor "row" not "rw"

* fix: grid editor permission name typos
  • Loading branch information
wesleyboar authored Nov 15, 2024
1 parent 13b5279 commit 42190a7
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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')
22 changes: 22 additions & 0 deletions taccsite_cms/management/commands/group_perms/grid_editor_basic.py
Original file line number Diff line number Diff line change
@@ -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')

0 comments on commit 42190a7

Please sign in to comment.