web/satellite: allow free users to invite if billing features disabled

This change ensures that the user is never prompted to upgrade when
attempting to invite project members if billing features are configured
to be disabled.

Change-Id: I1c49351b00c0e378da24ad080fd1d3b078c97c71
This commit is contained in:
Jeremy Wharton 2023-10-18 17:10:23 -05:00 committed by Storj Robot
parent a6222afdd0
commit 1d5ea2d35c
5 changed files with 6 additions and 4 deletions

View File

@ -26,6 +26,7 @@ type Config struct {
UserBalanceForUpgrade int64 `help:"amount of base units of US micro dollars needed to upgrade user's tier status" default:"10000000"` UserBalanceForUpgrade int64 `help:"amount of base units of US micro dollars needed to upgrade user's tier status" default:"10000000"`
PlacementEdgeURLOverrides PlacementEdgeURLOverrides `help:"placement-specific edge service URL overrides in the format {\"placementID\": {\"authService\": \"...\", \"publicLinksharing\": \"...\", \"internalLinksharing\": \"...\"}, \"placementID2\": ...}"` PlacementEdgeURLOverrides PlacementEdgeURLOverrides `help:"placement-specific edge service URL overrides in the format {\"placementID\": {\"authService\": \"...\", \"publicLinksharing\": \"...\", \"internalLinksharing\": \"...\"}, \"placementID2\": ...}"`
BlockExplorerURL string `help:"url of the transaction block explorer" default:"https://etherscan.io/"` BlockExplorerURL string `help:"url of the transaction block explorer" default:"https://etherscan.io/"`
BillingFeaturesEnabled bool `help:"indicates if billing features should be enabled" default:"true"`
UsageLimits UsageLimitsConfig UsageLimits UsageLimitsConfig
Captcha CaptchaConfig Captcha CaptchaConfig
Session SessionConfig Session SessionConfig

View File

@ -111,7 +111,6 @@ type Config struct {
UseVuetifyProject bool `help:"whether to use vuetify POC project" default:"false"` UseVuetifyProject bool `help:"whether to use vuetify POC project" default:"false"`
VuetifyHost string `help:"the subdomain the vuetify POC project should be hosted on" default:""` VuetifyHost string `help:"the subdomain the vuetify POC project should be hosted on" default:""`
ObjectBrowserPaginationEnabled bool `help:"whether to use object browser pagination" default:"false"` ObjectBrowserPaginationEnabled bool `help:"whether to use object browser pagination" default:"false"`
BillingFeaturesEnabled bool `help:"indicates if billing features should be enabled" default:"true"`
OauthCodeExpiry time.Duration `help:"how long oauth authorization codes are issued for" default:"10m"` OauthCodeExpiry time.Duration `help:"how long oauth authorization codes are issued for" default:"10m"`
OauthAccessTokenExpiry time.Duration `help:"how long oauth access tokens are issued for" default:"24h"` OauthAccessTokenExpiry time.Duration `help:"how long oauth access tokens are issued for" default:"24h"`

View File

@ -3775,7 +3775,7 @@ func (s *Service) inviteProjectMembers(ctx context.Context, sender *User, projec
} }
projectID = isMember.project.ID projectID = isMember.project.ID
if !(s.config.FreeTierInvitesEnabled || sender.PaidTier) { if s.config.BillingFeaturesEnabled && !(s.config.FreeTierInvitesEnabled || sender.PaidTier) {
return nil, ErrNotPaidTier.New(paidTierInviteErrMsg) return nil, ErrNotPaidTier.New(paidTierInviteErrMsg)
} }

View File

@ -116,7 +116,8 @@ const formError = computed<string | boolean>(() => {
* Returns whether the user should upgrade to pro tier before inviting. * Returns whether the user should upgrade to pro tier before inviting.
*/ */
const needsUpgrade = computed<boolean>(() => { const needsUpgrade = computed<boolean>(() => {
return !(usersStore.state.user.paidTier || configStore.state.config.freeTierInvitesEnabled); const config = configStore.state.config;
return config.billingFeaturesEnabled && !(usersStore.state.user.paidTier || config.freeTierInvitesEnabled);
}); });
/** /**

View File

@ -166,7 +166,8 @@ const emailRules: ValidationRule<string>[] = [
* Returns whether the user should upgrade to pro tier before inviting. * Returns whether the user should upgrade to pro tier before inviting.
*/ */
const needsUpgrade = computed<boolean>(() => { const needsUpgrade = computed<boolean>(() => {
return !(usersStore.state.user.paidTier || configStore.state.config.freeTierInvitesEnabled); const config = configStore.state.config;
return config.billingFeaturesEnabled && !(usersStore.state.user.paidTier || config.freeTierInvitesEnabled);
}); });
/** /**