Skip to content
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

chore: merge project permissions into advanced permissions #28115

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zlwaterfield
Copy link
Contributor

@zlwaterfield zlwaterfield commented Jan 30, 2025

Changes

Follow along on RBAC: #24512

Billing PR to be shipped after this: https://github.com/PostHog/billing/pull/1092

Deprecating project_based_permissioning and merging into advanced_permissions.

Currently advanced_permissions is used for dashboard permissions and project_based_permissioning is used for permissions around projects like private projects. With the new RBAC / access control system we are merging these together and they will be available on the teams add-on.

Since both of these are available on the same plans right now, this should have no affect to users. I confirmed that every plan that has advanced_permissions also has project_based_permissioning and vice versa.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

It doesn't have an impact.

How did you test this code?

Copy link
Contributor

github-actions bot commented Jan 30, 2025

Size Change: -766 B (-0.07%)

Total Size: 1.16 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.16 MB -766 B (-0.07%)

compressed-size-action

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

6 snapshot changes in total. 0 added, 6 modified, 0 deleted:

  • chromium: 0 added, 6 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR consolidates project-based permissions into advanced permissions across the PostHog codebase. Here's a summary of the key changes:

  • Removes PROJECT_BASED_PERMISSIONING feature flag and merges its functionality into ADVANCED_PERMISSIONS across all files
  • Updates feature checks in access control components and logic to use ADVANCED_PERMISSIONS instead of PROJECT_BASED_PERMISSIONING
  • Maintains existing functionality since both features were previously available on the same plans
  • Aligns with new RBAC/access control system where permissions will be available through teams add-on
  • Includes comprehensive test updates to verify permission system still works correctly after consolidation

Key points to review:

  • TODO comment on line 115 in AccessControlObject.tsx about index mapping needs to be addressed
  • Migration path for existing installations should be verified to ensure smooth transition
  • Documentation and frontend code references to PROJECT_BASED_PERMISSIONING need to be updated
  • Legacy test classes that are commented out should be reviewed for proper migration to new system

16 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

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.

3 participants