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

feat: [M3-6759] - Handle VPC Account Grants / Permissions / Capabilities #9585

Merged
merged 14 commits into from
Sep 5, 2023

Conversation

coliu-akamai
Copy link
Contributor

@coliu-akamai coliu-akamai commented Aug 22, 2023

Description 📝

Add VPC grants, permissions, and capabilities to determine VPC usage

Major Changes 🔄

  • add VPC related grants to User Permissions page
  • add isFeatureEnabledFunctionality

Preview 📷

User Permissions:

image
no permissions:
image
image
image

Before After
image image

How to test 🧪

  1. Test that user permissions ^ show up (either on MSW or possibly even dev account?)
  2. Test if you can see any VPC pages while not on MSW (will need to have the relevant capability)
  3. try to test editing a VPC when it is read_only (may need to add another user to change their permissions)
  4. Try creating a vpc on an account that does not have the global permissions

@coliu-akamai coliu-akamai self-assigned this Aug 22, 2023
@coliu-akamai coliu-akamai added the VPC Relating to VPC project label Aug 22, 2023
@coliu-akamai coliu-akamai marked this pull request as ready for review August 22, 2023 20:33
Copy link
Contributor

@dwiley-akamai dwiley-akamai left a comment

Choose a reason for hiding this comment

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

@coliu-akamai you can get a read-only VPC by creating a restricted user (if you don't have one already), and then from the main account, going to Users & Grants > User Permissions for the restricted user and marking that VPC as read-only for them. Then log in as the restricted user and confirm they can't edit anything for that VPC

coliu-akamai and others added 2 commits August 23, 2023 14:20
Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>
…12038.md

Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>
@coliu-akamai
Copy link
Contributor Author

thanks @dwiley-akamai, that worked!
image

@coliu-akamai coliu-akamai added the @linode/api-v4 Changes are made to the @linode/api-v4 package label Aug 24, 2023
Copy link
Contributor

@dwiley-akamai dwiley-akamai left a comment

Choose a reason for hiding this comment

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

Looks good so far -- we'll want to have the isFeatureEnabled() logic in MainContent.tsx, AddNewMenu.tsx, and PrimaryNav.tsx too.

Also, VPCs show up on the landing page even if a restricted user's VPC permissions are set to "None" -- I think that may be an API bug since I tried from the command line and observed a similar result

@coliu-akamai
Copy link
Contributor Author

thanks @dwiley-akamai, just added for those files! Will also make sure to stay up to date on your post about the potential bug

coliu-akamai and others added 2 commits August 28, 2023 12:38
Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>
Copy link
Contributor

@dwiley-akamai dwiley-akamai left a comment

Choose a reason for hiding this comment

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

LGTM, just have to merge in the latest develop and resolve the conflicts 🚢

@bnussman-akamai bnussman-akamai added Add'tl Approval Needed Waiting on another approval! and removed Ready for Review labels Aug 29, 2023
@bnussman-akamai bnussman-akamai added Ready for Review and removed Add'tl Approval Needed Waiting on another approval! labels Aug 30, 2023
Copy link
Contributor

@dwiley-akamai dwiley-akamai left a comment

Choose a reason for hiding this comment

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

Didn't realize my review got dismissed earlier in the week 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, same thing happened on the Subnets PR with this file being pulled in somehow 🤔

Copy link
Contributor Author

@coliu-akamai coliu-akamai Sep 1, 2023

Choose a reason for hiding this comment

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

Wondering if it's a prettier or eslint thing? Gonna try to get rid of the change

edit: yeah prettier moves the line down, then eslint doesn't let me commit without changes. I could add --no-verify to bypass, but since prettier will probably keep on moving the line back down anyway, I think it's fine to keep the changes

@coliu-akamai
Copy link
Contributor Author

@dwiley-akamai sorry that was actually me -- I'd rerequested a review for the grant related changes I'd made for the VPC column in the linodes landing table, but since we undid that change, the review request turned out to be unnecessary 😅

Copy link
Contributor

@hana-akamai hana-akamai left a comment

Choose a reason for hiding this comment

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

LGTM other than the "None" issue that Dajahi mentioned!

@coliu-akamai
Copy link
Contributor Author

@hana-linode ty Hana! VPCs with permissions set to none will still show up due to API design, so we're treating them as read_only and have added in explanatory comment for this. gonna merge this! 🎉

@coliu-akamai coliu-akamai merged commit 0ba597b into linode:develop Sep 5, 2023
corya-akamai pushed a commit to corya-akamai/manager that referenced this pull request Sep 6, 2023
…ies (linode#9585)

* add vpc grant and permissions

* yarn changeset

* Update packages/api-v4/.changeset/pr-9585-changed-1692736077405.md

Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>

* Update packages/manager/.changeset/pr-9585-upcoming-features-1692736112038.md

Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>

* fix unresolved merge conflict issues

* update vpc global grant text

* add missing files

* Update packages/manager/src/features/VPC/VPCLanding/VPCEditDrawer.tsx

Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>

* add comment to explain VPC permissions

---------

Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>
abailly-akamai pushed a commit that referenced this pull request Sep 7, 2023
…ies (#9585)

* add vpc grant and permissions

* yarn changeset

* Update packages/api-v4/.changeset/pr-9585-changed-1692736077405.md

Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>

* Update packages/manager/.changeset/pr-9585-upcoming-features-1692736112038.md

Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>

* fix unresolved merge conflict issues

* update vpc global grant text

* add missing files

* Update packages/manager/src/features/VPC/VPCLanding/VPCEditDrawer.tsx

Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>

* add comment to explain VPC permissions

---------

Co-authored-by: Dajahi Wiley <114682940+dwiley-akamai@users.noreply.github.com>
@coliu-akamai coliu-akamai deleted the feat-m3-6759 branch September 26, 2023 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@linode/api-v4 Changes are made to the @linode/api-v4 package Ready for Review VPC Relating to VPC project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants