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

Clarify Entitlement Handling for Sub-Projects #5001

Open
teodor-yanev opened this issue Nov 19, 2024 · 0 comments
Open

Clarify Entitlement Handling for Sub-Projects #5001

teodor-yanev opened this issue Nov 19, 2024 · 0 comments

Comments

@teodor-yanev
Copy link
Contributor

When creating child projects (sub-projects), we currently create entitlements based on the features of the parent project member who initiates the creation. This process is handled separately from the internal/projects code, which may not be the ideal approach.

Here's the relevant code snippet:

// Retrieve the membership-to-feature mapping from the configuration
projectFeatures := s.cfg.Features.GetFeaturesForMemberships(ctx)
if err := qtx.CreateEntitlements(ctx, db.CreateEntitlementsParams{
    Features:  projectFeatures,
    ProjectID: subProject.ID,
}); err != nil {
    return nil, status.Errorf(codes.Internal, "error creating entitlements: %v", err)
}

It's unclear how entitlements for sub-projects should be handled. There are a few options:

  • Copy entitlements from the parent project.
  • Use entitlements based on the specific parent project member who creates them. (Current implementation)
  • Have an empty set of entitlements and extend entitlement queries to check parent projects.

Currently, we're following option 2, but it's not clear if this is the correct approach.

We need to determine the desired method for handling entitlements in sub-projects. Specifically:

  • Should sub-projects inherit entitlements from their parent projects?
  • Is it appropriate to base entitlements on the creator's features?
  • Would it be better to have sub-projects start with no entitlements and adjust our entitlement queries accordingly?

Next Steps:

@ethomson, could you please provide guidance on how we should handle entitlements for sub-projects?

CC: @ethomson @evankanderson

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

No branches or pull requests

1 participant