Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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
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
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.