Skip to content

Introduce cms_admin role, drop generic admin; add author-name editing - #14

Merged
dev11-web merged 1 commit into
masterfrom
stage
Jul 24, 2026
Merged

Introduce cms_admin role, drop generic admin; add author-name editing#14
dev11-web merged 1 commit into
masterfrom
stage

Conversation

@nervesparksdev08

Copy link
Copy Markdown
  • Replaces the generic admin role with a single cms_admin role across the CMS backend — role == "admin" checks in core/deps.py and app/routers/blogs.py (cross-tenant view/delete/update/draft checks) now check cms_admin, and the Literal["user", "admin"] role enum in app/models/schemas.py is updated to match.
  • Adds PUT/POST /admin/blogs/{blog_id}/author — lets a cms_admin set or clear (nullable) a blog's author_name, independent of category management.

Why
Company wants a narrower "content approver" role that can only review/approve/manage blogs, distinct from a full platform admin. author_name needed to be admin-editable and nullable to support blogs migrated/reassigned between tenants without a hard author binding.

Test plan

  • Confirm a cms_admin JWT can hit /admin/blogs/pending, /published, /approve, /reject, /blogs/{id}/author.
  • Confirm a plain user role gets 403 on all admin/* routes and blog cross-tenant actions.
  • Set an author name, clear it (empty string → null in DB), verify persists.

@dev11-web
dev11-web merged commit a5481e5 into master Jul 24, 2026
1 check passed
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.

2 participants