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

enterprise feature: project-level membership #8569

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

mayberryzane
Copy link
Contributor

@mayberryzane mayberryzane commented May 14, 2024

Summary

  • adds an enterprise ability to set project-level access for users with member role
  • changes invites to default to member (onboarding, invite through members page, workspace secret link)
  • renames some of the resolver methods to be more clear about what kind of permissions are being checked
    https://www.loom.com/share/8b4de7ae89b44e13ad0c88055f2bec13

How did you test this change?

  • clicktested locally
  • unit test for various access level resolver methods and Projects resolver

Are there any deployment considerations?

  • no

Does this work require review from our design team?

Copy link

changeset-bot bot commented May 14, 2024

⚠️ No Changeset found

Latest commit: 788f8f1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "rrdom" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrdom-nodejs" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrweb" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrweb-player" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrweb-snapshot" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@rrweb/types" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@rrweb/web-extension" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrvideo" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

@mayberryzane mayberryzane marked this pull request as ready for review May 17, 2024 00:06
@mayberryzane mayberryzane requested review from a team and ccschmitz and removed request for a team May 17, 2024 00:06
break
}

args, err := ec.field_Mutation_changeProjectMembership_args(context.TODO(), rawArgs)

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
Copy link
Contributor

@ccschmitz ccschmitz left a comment

Choose a reason for hiding this comment

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

Code + click test are looking good!

One thing I noticed is that non-admins still have access to some of the admin UI even though the page doesn't really work for them. For example, if I'm a project-level member, I can still access /w/${workspaceId} even though I see an error.

Screenshot 2024-05-21 at 2 37 16 PM

Think it would be worthwhile to only define those routes for admins inside AppRouter?

I also think we might be linking to some admin-only pages for members too. e.g. LogsOverageCard, the session overage CTA, the default settings page redirect, and possibly a few more (I tried to audit the places I saw /w/${ in the app.

@@ -455,23 +431,71 @@ func (r *Resolver) addAdminMembership(ctx context.Context, workspaceId int, invi
return &admin.ID, nil
}

func (r *Resolver) DeleteAdminAssociation(ctx context.Context, obj interface{}, adminID int) (*int, error) {
func (r *Resolver) isUserInWorkspaceReadOnly(ctx context.Context, workspaceID int) (*model.Workspace, error) {
span, ctx := util.StartSpanFromContext(ctx, "isAdminInWorkspace", util.ResourceName("resolver.internal.auth"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit, should we update the span name?

Suggested change
span, ctx := util.StartSpanFromContext(ctx, "isAdminInWorkspace", util.ResourceName("resolver.internal.auth"))
span, ctx := util.StartSpanFromContext(ctx, "isUserInWorkspace", util.ResourceName("resolver.internal.auth"))

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.

None yet

2 participants