[WEB-2449] fix: admin is not able to edit issues in notifications peek overview#5877
[WEB-2449] fix: admin is not able to edit issues in notifications peek overview#5877
Conversation
This reverts commit 208636d.
WalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested reviewers
Poem
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 (
|
|
|
||
| const isEditable = | ||
| allowPermissions([EUserPermissions.ADMIN], EUserPermissionsLevel.PROJECT) || | ||
| allowPermissions([EUserPermissions.ADMIN], EUserPermissionsLevel.PROJECT, workspaceSlug, projectId) || |
There was a problem hiding this comment.
💡 Codebase verification
Inconsistent Usage of allowPermissions Across Codebase
Multiple instances of allowPermissions are still using the old signature without workspaceSlug and projectId parameters. Please update these calls to ensure consistent and secure permission checks.
Examples:
web/core/components/project-states/group-item.tsxweb/core/components/workspace/sidebar/workspace-menu.tsxweb/core/components/workspace/settings/workspace-details.tsx- (and others as identified by the verification script)
Additionally, address the following TODO:
apiserver/plane/app/permissions/workspace.py: Move the permission logic to Python.
🔗 Analysis chain
Approve: Enhanced permission check with workspace and project context
The addition of workspaceSlug and projectId parameters to the allowPermissions function call improves the granularity of the permission check. This change aligns with the PR objective of fixing admin editing capabilities in the notifications peek overview.
To ensure consistency and catch potential issues, please run the following verification script:
This script will help identify any inconsistencies in the usage of allowPermissions across the codebase and verify the necessary imports.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the usage of allowPermissions function across the codebase
# Test 1: Check for any remaining calls to allowPermissions without workspaceSlug and projectId
echo "Checking for outdated allowPermissions calls:"
rg "allowPermissions\(\[.*\],\s*EUserPermissionsLevel\.[A-Z]+\s*\)" -g '!*.test.*'
# Test 2: Verify the import of necessary constants
echo "Verifying imports:"
rg "import.*EUserPermissions.*EUserPermissionsLevel.*from.*plane-web/constants/user-permissions" -g '!*.test.*'
# Test 3: Check for any TODO or FIXME comments related to permissions
echo "Checking for TODO/FIXME comments related to permissions:"
rg "TODO|FIXME" -g '!*.test.*' | rg -i "permission"
Length of output: 23263
[WEB-2449]
Previously: Admin is not able to edit issues in inbox peek overview
Screen.Recording.2024-10-21.at.3.40.07.PM.mov
Now: Admin is allowed to edit
Screen.Recording.2024-10-21.at.3.30.41.PM.mov
Summary by CodeRabbit
New Features
Bug Fixes