diff --git a/src/sentry/api/endpoints/organization_member_team_details.py b/src/sentry/api/endpoints/organization_member_team_details.py
index 9802d80ebde9eb..3007c31f51d166 100644
--- a/src/sentry/api/endpoints/organization_member_team_details.py
+++ b/src/sentry/api/endpoints/organization_member_team_details.py
@@ -56,6 +56,7 @@ def _can_access(self, request, member, organization):
* If they are modifying their own membership
* If the user's role is higher than the targeted user's role (e.g. "admin" can't modify "owner")
* If the user is an "admin" and they are modifying a team they are a member of
+ * If the "open membership" setting is enabled and the targeted user is being added to a team
"""
if is_active_superuser(request):
@@ -76,6 +77,9 @@ def _can_access(self, request, member, organization):
):
return True
+ if request.method == "POST" and organization.flags.allow_joinleave:
+ return True
+
return False
def _can_admin_team(self, request, organization, team_slug):
diff --git a/src/sentry/static/sentry/app/views/settings/organizationTeams/teamDetails.jsx b/src/sentry/static/sentry/app/views/settings/organizationTeams/teamDetails.jsx
index 40f822f3836553..51bb01922ba6db 100644
--- a/src/sentry/static/sentry/app/views/settings/organizationTeams/teamDetails.jsx
+++ b/src/sentry/static/sentry/app/views/settings/organizationTeams/teamDetails.jsx
@@ -137,11 +137,11 @@ const TeamDetails = createReactClass({
} else if (!team || !team.hasAccess) {
return (
-
{t('You do not have access to this team')}
-
- {team && (
+ {team ? (
- {tct('You may try to request access to [team]', {team: `#${team.slug}`})}
+ {tct('You do not have access to the [teamSlug] team.', {
+ teamSlug: {`#${team.slug}`},
+ })}
+ ) : (
+