Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: better group perms mgmt #895

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

wesleyboar
Copy link
Member

@wesleyboar wesleyboar commented Nov 12, 2024

Overview

Allow developers to offer Groups with overlapping permissions but less redundant code.

Status

Related

Changes

  • added a util.py
  • added a function add_perm
  • changed group permissions to use new utility function
  • added "Grid Editor (Basic)" and "Grid Editor (Advanced)"
  • added permission Can change static placeholder1

Testing

  1. Create/Open a Core-CMS instance.
  2. In the docker, run:
    • python manage.py set_group_perms grid_editor_basic grid_editor_advanced text_editor_basic text_editor_advanced media_editor_basic media_editor_advanced news_writer_basic news_writer_advanced
  3. In CMS admin UI, verify those 8 groups are created.
  4. Verify the groups each have relevant permissions.
    I merely skimmed the results.

UI

before after
before after
grid media news text
grid basic media basic news basic text basic
grid adv media adv news adv text adv

Footnotes

  1. Let's editor see "Edit" and "View published" button. WTCS users could not. One avid TACC editor sometimes can not.

* chore: remove unused imports

* refactor: add & use add_perm utility function

* docs: add & use add_perm utility function

* docs: missing spaces

* docs: missing spaces
* feat: grid editor (⚠️ untested)

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

* fix: grid editor permission name typos
* refactor: consolidate add_perm calls (⚠️ untested)

* refactor: news_writer (⚠️ untested) & renames

* fix: user lacks [Edit] / [View published] buttons

* fix: errors adding permissions
@wesleyboar wesleyboar marked this pull request as ready for review November 18, 2024 22:26
@wesleyboar wesleyboar changed the title feat: simplify group mgmt for admins feat: simplify group perms mgmt Nov 18, 2024
@wesleyboar wesleyboar changed the title feat: simplify group perms mgmt feat:"better" group perms mgmt Nov 18, 2024
@wesleyboar wesleyboar changed the title feat:"better" group perms mgmt feat: better group perms mgmt Nov 18, 2024
Copy link
Member Author

@wesleyboar wesleyboar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tasks
From joint peer code review on Zoom:

  • Document what each of these groups provide for the user (one sentence) i.e. why you would give someone this group.
  • Add a custom migration for these. (New migration might remove/change permissions.)
    • The migration could empty the existing permission form existing groups, then run the scripts.
    • A good primer on migration.

@wesleyboar wesleyboar marked this pull request as draft November 19, 2024 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant