Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

ayham291
Copy link
Contributor

Git Provider Ownership Control (issue #2220)

Overview

This PR implements ownership-based access control for git provider sharing settings, ensuring that only the creator of a git provider can toggle its "Share in Organization" setting. This change enhances security by preventing unauthorized users from modifying sharing permissions of git providers they don't own.

Changes

Access Control Implementation

  • UI Changes: Modified ShowGitProviders component to conditionally render the "Share in Organization" switch only for providers owned by the current user
  • Server Validation: Add updateSharedInOrg mutation to validate both organization membership AND user ownership before allowing sharing toggle updates

Code Changes

  • Frontend: Added session-based ownership check in show-git-providers.tsx
  • Backend: Consolidated authorization checks in git-provider.ts router to validate both organization and ownership in a single condition

Security Impact

  • Git provider sharing settings are now strictly controlled by their owners
  • Users cannot modify sharing permissions of providers they didn't create
  • Organization-level access control remains intact for viewing shared providers

Testing

Please verify:

  • Only providers you created show the "Share in Organization" switch
  • You cannot toggle sharing for providers created by other users
  • Server properly rejects unauthorized sharing update attempts
  • Shared providers from other users are still visible but not editable
  • Organization-level provider visibility remains functional
image

Future Considerations

This change provides a foundation for more granular provider management features, such as:

  • Transferring provider ownership
  • Delegating sharing permissions to specific users
  • Audit logging for sharing permission changes

Breaking Changes

None

- Introduced a new boolean column `sharedInOrg` in the `git_provider` table to manage sharing settings.
- Implemented a toggle switch in the UI to allow users to update the sharing status of their Git providers.
- Updated API routes to handle authorization based on the new sharing feature, ensuring only authorized users can modify shared settings.
- Enhanced filtering logic to include shared Git providers in user queries.
@ayham291 ayham291 requested a review from Siumauricio as a code owner October 10, 2025 11:15
ayham291 and others added 3 commits October 13, 2025 14:58
- Scope visibility to the active organization
- Allow access only if owner or shared within that org
- Unify access checks and listing filters across routers
- Use shared canAccessProvider/filterVisibleProviders helpers
- Prevent cross-org exposure
- Require organization-scoped checks for Git provider routes
- Align router and service validation to prevent cross-org access
- add missing drizzle snapshot and journal
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.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.