[WEB-2488] fix: only the owner of a view can publish their project views#5799
[WEB-2488] fix: only the owner of a view can publish their project views#5799sharma01ketan wants to merge 3 commits intopreviewfrom
Conversation
WalkthroughThe changes in this pull request focus on modifying the Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
web/core/components/views/quick-actions.tsx (1)
41-41: Suggestion: Add an explanatory commentConsider adding a comment above this line to explain the reasoning behind restricting the publish action to only the owner. This will help future developers understand the intentional permission restriction.
Example comment:
// Only the view owner can publish to ensure strict control over view publication
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- web/core/components/views/quick-actions.tsx (1 hunks)
🧰 Additional context used
🔇 Additional comments (1)
web/core/components/views/quick-actions.tsx (1)
41-41: Approved: Restrict publish action to view owner onlyThis change aligns with the PR objective of allowing only the owner to publish their view. It enhances security and control over project views.
To ensure consistency across the codebase, please run the following script:
This script will help identify any inconsistencies in publish permissions across the codebase.
✅ Verification successful
To address the issues with the previous script, please run the following updated shell scripts:
Verified: Publish actions are correctly restricted to view owners only
The shell script results confirm that there are no other instances where
isAdmincontrols publish permissions. This ensures that only the view owner can publish, aligning with the PR objectives and maintaining consistency across the codebase.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that publish actions are restricted to view owners across the codebase # Test 1: Search for other occurrences of useViewPublish echo "Searching for other occurrences of useViewPublish:" rg --type typescript --type tsx "useViewPublish\(" -C 3 # Test 2: Search for other publish-related functions or components echo "Searching for other publish-related functions or components:" rg --type typescript --type tsx "publish.*view" -i -C 3 # Test 3: Search for admin-related publish permissions echo "Searching for admin-related publish permissions:" rg --type typescript --type tsx "isAdmin.*publish" -C 3Length of output: 627
Script:
#!/bin/bash # Description: Verify that publish actions are restricted to view owners across the codebase # Test 1: Search for other occurrences of useViewPublish echo "Searching for other occurrences of useViewPublish:" rg "useViewPublish\(" --glob "*.ts" --glob "*.tsx" -C 3 # Test 2: Search for other publish-related functions or components echo "Searching for other publish-related functions or components:" rg "publish.*view" -i --glob "*.ts" --glob "*.tsx" -C 3 # Test 3: Search for admin-related publish permissions echo "Searching for admin-related publish permissions:" rg "isAdmin.*publish" --glob "*.ts" --glob "*.tsx" -C 3Length of output: 20824
|
This change is not required. |
[WEB-2488]
This PR changes the permission level of Project Views: Only the owner of a Project View can publish the view.
For Admin:
Screen.Recording.2024-10-11.at.1.05.46.PM.mov
For Member:
Screen.Recording.2024-10-11.at.1.06.18.PM.mov
Summary by CodeRabbit
New Features
Bug Fixes