-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix: #7633 page global perms 'can_view' unclear admin ui text #8256
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
base: main
Are you sure you want to change the base?
fix: #7633 page global perms 'can_view' unclear admin ui text #8256
Conversation
Reviewer's GuideThis PR refines the semantics of the page-level “can_view” permission by updating its admin help text, adding a migration for the change, and introducing tests to ensure it only grants access to published restricted pages and not to unpublished ones. Class diagram for updated AbstractPagePermission and PagePermission modelsclassDiagram
class AbstractPagePermission {
+BooleanField can_change_permissions
+BooleanField can_move_page
+BooleanField can_view
}
note for AbstractPagePermission "can_view: Grants access to published pages with view restrictions. Does not allow viewing unpublished pages."
class PagePermission {
+BooleanField can_view
}
note for PagePermission "can_view: Grants access to published pages with view restrictions. Does not allow viewing unpublished pages."
AbstractPagePermission <|-- PagePermission
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @wesleyboar - I've reviewed your changes - here's some feedback:
- Please remove the “Generated by AI (Claude Sonnet 3.5)” header from the migration file to keep the commit history clean.
- Now that the changes are complete, you can delete or update the “[!IMPORTANT] Incomplete” note in the PR description.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Please remove the “Generated by AI (Claude Sonnet 3.5)” header from the migration file to keep the commit history clean.
- Now that the changes are complete, you can delete or update the “[!IMPORTANT] Incomplete” note in the PR description.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
In response to @sorcery-ai:
Not unless a human says so, because the comment has purpose.Other migrations have comment that they were auto-generated, so I think this was should explain how it was generated.
I suggest we not require that be addressed, because it is working as intended.It's annoying to stumble through the error, but (1) I have not found a built in field-value-dependency mechanism in Django, (2) building a one-off with JavaScript seems like overkill, and (3) something like that would "best" be done by Django or Django CMS as a new feature any admin form could use. |
@wesleyboar Thanks for clarifying and creating this! This clearly is v3 code - as of v4, no publishing logic is available in django CMS' core. Tests will fail :-( Can I suggest the following:
Now, django CMS 3.11 must not contain new migrations. Since you only change the label and help text of model fields, the corresponding migration is a database no-op. I suggest updating the latest relevant one instead of creating a new one. |
Excellent. Makes sense.* Tasks added. PR converted to draft. * Does it, though? Yes; see notes for self.
|
Description
Clarify misleadingly vague model description.
Important
Status:
release/3.11.X
.v3.11.x
.— #8256 (comment)
Related resources
release/3.11.x
?Checklist
main