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

Create new admin putOrg endpoint #2509

Merged
merged 1 commit into from May 13, 2024
Merged

Create new admin putOrg endpoint #2509

merged 1 commit into from May 13, 2024

Conversation

tzjames
Copy link
Collaborator

@tzjames tzjames commented May 11, 2024

Features and Changes

In #2452 we added ability for editing licenseKeys on the admin page. However it only worked if the superAdmin was also a member of the org. It is also possible that superAdmin's had in the past been able to edit any org, but we got rid of that to make sure superAdmins generally have read only access. However on the /admin page we want them to have certain limited abilities to edit. Hence this PR adds a new admin specific PutOrganization method that only allows putting the attributes we want them to be able to edit.

Testing

For the following tests use a user that has a "superAdmin: true" property set, but which is not a member of the organization that is being edited:

Testing Cloud

yarn test
in back-end and front-end/.env.local

IS_CLOUD=true
IS_MULTI_ORG=true
SSO_CONFIG=valid SSO config

restart the server
Go to settings->general - see no input to edit the license.
Go to settings->admin - click org and the pencil icon
Edit the license with a bad license
See invalid licenseKey message
Enter in a valid licenseKey
See it update successfully.
Refresh the page, and see the new license show up.

Testing Self-Hosted Multi-Org (license key should only set by env var)

in back-end and front-end/.env.local

IS_CLOUD=false
IS_MULTI_ORG=true

restart server
Go to Settings->admin page
Click pencil icon on an organization
See the externalId, but not the licenseKey field.
Go to Settings->General
See no license section at all.

Testing normal Self-Hosted

in back-end and front-end/.env.local

IS_CLOUD=false
IS_MULTI_ORG=false

restart server
Go to Settings->General
Click pencil icon by license.
Enter "license_bad"
See "Invalid license key" message upon submit
Put in a valid license key.
See it succeed.

@tzjames tzjames requested review from jdorn and mknowlton89 May 11, 2024 09:19
Copy link

Your preview environment pr-2509-bttf has been deployed.

Preview environment endpoints are available at:

@tzjames tzjames merged commit e1035df into main May 13, 2024
3 checks passed
@tzjames tzjames deleted the ji/admin-put-org branch May 13, 2024 11:18
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