Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughCredential copying now uses organization-level creation permissions when an organization exists. New tests cover role-based access, organization-less credentials, endpoint capabilities, and copied credential attributes. ChangesCredential copy RBAC
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change enables authorized organization credential managers to use Duplicate consistently with the copy API; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Org admins and credential_admin_role members were unable to copy organization-owned credentials because CredentialAccess had no can_copy implementation, causing the generic fallback (can_change) to be used instead. This led to the copy endpoint and user_capabilities.copy giving inconsistent or incorrect results. Does not affect personal/no-org credentials, direct-only credential admins, or non-admin org members; only aligns copy for org-owned credentials where the user already has org-level create permission. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Max Mitschke <mmitschk@redhat.com>
|



SUMMARY
The problem
Users who are allowed to manage credentials in an organization—org admins and users with the org Credential Admin role—could not use the Duplicate button on organization-owned credentials. The button stayed greyed out even though those users were permitted to create credentials in that org.
Behind the scenes, the platform was giving two different answers to the same question (“can this user copy this credential?”):
user_capabilities.copy) and said no./credentials/<id>/copy/) said yes and would actually perform the copy if called directly.So this was a permissions signaling bug: the user had the right access, but the UI was not told about it. Superusers were unaffected because they bypass these checks.
Why it happened
When the UI asks whether someone can duplicate a credential, the code checks “can this user create a new credential like this one?” For org credentials, that means “can they create a credential in this organization?”
The check for the UI was not passing the organization along—it only handed over a reference to the existing credential. The permission logic did not look inside that object for the org, so it treated the request as if no owner was specified and denied access. The copy API, by contrast, already included the organization in its request, so it correctly allowed the action.
What this commit does
Adds a dedicated
can_copyrule for credentials that, for organization-owned credentials, asks the same question the copy API already asks: “can this user create a credential in this organization?” That alignsuser_capabilities.copywith the copy endpoint so the Duplicate button matches what users are actually allowed to do.What this does not change
ISSUE TYPE
COMPONENT NAME
STEPS TO REPRODUCE AND EXTRA INFO
Prerequisites: Controller API access; non-superuser with org Credential Admin on an org that has at least one org-scoped credential.
testuser.testuserto the team.testuser:Expected after fix:
user_capabilities.copyandcan_copyare bothtruefor org Credential Admin; Duplicate is enabled in the UI.Summary by CodeRabbit