Repository: bitwarden/android
Pull request #5114: [PM-14222] Managed user account deletion prevention
Author: login: aj-rosado
Created: 2025-04-30T16:18:13Z | Merged: 2025-05-02T20:51:16Z

## 🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-14222

## 📔 Objective

Users managed by organization should not be allowed to deleted their accounts.

## 📸 Screenshots
<img width="314" alt="User cannot delete account screen" src="https://github.com/user-attachments/assets/6329bc96-aa7e-4e84-a582-81744a6707eb">

<img width="314" alt="User delete account screen" src="https://github.com/user-attachments/assets/440c794c-964a-4417-a6d8-5ecb41d23399">

## ⏰ Reminders before review

- Contributor guidelines followed
- All formatters and local linters executed and passed
- Written new unit and / or integration tests where applicable
- Protected functional changes with optionality (feature flags)
- Used internationalization (i18n) for all UI strings
- CI builds passed
- Communicated to DevOps any deployment requirements
- Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

## 🦮 Reviewer guidelines

<!-- Suggested interactions but feel free to use (or not) as you desire! -->

- 👍 (`:+1:`) or similar for great changes
- 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info
- ❓ (`:question:`) for questions
- 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
- 🎨 (`:art:`) for suggestions / improvements
- ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention
- 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt
- ⛏ (`:pick:`) for minor or nitpick changes



Diff:
diff --git a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/model/Organization.kt b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/model/Organization.kt
index 48c8f1350a8..ddbc4fa48f6 100644
--- a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/model/Organization.kt
+++ b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/model/Organization.kt
@@ -20,4 +20,5 @@ data class Organization(
     val shouldUseKeyConnector: Boolean,
     val role: OrganizationType,
     val keyConnectorUrl: String?,
+    val userIsClaimedByOrganization: Boolean,
 )
diff --git a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/SyncResponseJsonExtensions.kt b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/SyncResponseJsonExtensions.kt
index ba2dde0e8c1..f64bfa775e6 100644
--- a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/SyncResponseJsonExtensions.kt
+++ b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/SyncResponseJsonExtensions.kt
@@ -23,6 +23,7 @@ fun SyncResponseJson.Profile.Organization.toOrganization(): Organization =
         role = this.type,
         shouldManageResetPassword = this.permissions.shouldManageResetPassword,
         keyConnectorUrl = this.keyConnectorUrl,
+        userIsClaimedByOrganization = this.userIsClaimedByOrganization,
     )
 
 /**
diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountScreen.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountScreen.kt
index a0f0738c01d..ec6039b30ab 100644
--- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountScreen.kt
+++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountScreen.kt
@@ -2,12 +2,14 @@ package com.x8bit.bitwarden.ui.platform.feature.settings.accountsecurity.deletea
 
 import android.widget.Toast
 import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Row
 import androidx.compose.foundation.layout.Spacer
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.foundation.layout.fillMaxWidth
 import androidx.compose.foundation.layout.height
 import androidx.compose.foundation.layout.navigationBarsPadding
 import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.width
 import androidx.compose.foundation.rememberScrollState
 import androidx.compose.foundation.verticalScroll
 import androidx.compose.material3.ExperimentalMaterial3Api
@@ -20,22 +22,27 @@ import androidx.compose.runtime.getValue
 import androidx.compose.runtime.mutableStateOf
 import androidx.compose.runtime.remember
 import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.input.nestedscroll.nestedScroll
 import androidx.compose.ui.platform.LocalContext
 import androidx.compose.ui.platform.testTag
 import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.tooling.preview.Preview
 import androidx.compose.ui.unit.dp
 import androidx.hilt.navigation.compose.hiltViewModel
 import androidx.lifecycle.compose.collectAsStateWithLifecycle
 import com.x8bit.bitwarden.R
 import com.x8bit.bitwarden.ui.platform.base.util.EventsEffect
+import com.x8bit.bitwarden.ui.platform.base.util.cardStyle
+import com.x8bit.bitwarden.ui.platform.base.util.standardHorizontalMargin
 import com.x8bit.bitwarden.ui.platform.components.appbar.BitwardenTopAppBar
 import com.x8bit.bitwarden.ui.platform.components.button.BitwardenFilledErrorButton
 import com.x8bit.bitwarden.ui.platform.components.button.BitwardenOutlinedErrorButton
 import com.x8bit.bitwarden.ui.platform.components.dialog.BitwardenBasicDialog
 import com.x8bit.bitwarden.ui.platform.components.dialog.BitwardenLoadingDialog
 import com.x8bit.bitwarden.ui.platform.components.dialog.BitwardenMasterPasswordDialog
+import com.x8bit.bitwarden.ui.platform.components.model.CardStyle
 import com.x8bit.bitwarden.ui.platform.components.scaffold.BitwardenScaffold
 import com.x8bit.bitwarden.ui.platform.components.util.rememberVectorPainter
 import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme
@@ -115,61 +122,52 @@ fun DeleteAccountScreen(
                 .fillMaxSize()
                 .verticalScroll(rememberScrollState()),
         ) {
-            Spacer(modifier = Modifier.height(8.dp))
-            Icon(
-                painter = rememberVectorPainter(id = R.drawable.ic_warning),
-                contentDescription = null,
-                tint = BitwardenTheme.colorScheme.status.error,
-                modifier = Modifier.padding(horizontal = 16.dp),
-            )
-            Spacer(modifier = Modifier.height(8.dp))
-            Text(
-                text = stringResource(id = R.string.deleting_your_account_is_permanent),
-                style = BitwardenTheme.typography.headlineSmall,
-                color = BitwardenTheme.colorScheme.status.error,
-                modifier = Modifier
-                    .fillMaxWidth()
-                    .padding(horizontal = 16.dp),
-            )
-            Spacer(modifier = Modifier.height(24.dp))
-            Text(
-                text = stringResource(id = R.string.delete_account_explanation),
-                style = BitwardenTheme.typography.bodyMedium,
-                color = BitwardenTheme.colorScheme.text.primary,
-                modifier = Modifier
-                    .fillMaxWidth()
-                    .padding(horizontal = 16.dp),
-            )
-            Spacer(modifier = Modifier.height(24.dp))
-            DeleteAccountButton(
-                onDeleteAccountConfirmDialogClick = remember(viewModel) {
-                    {
-                        viewModel.trySendAction(
-                            DeleteAccountAction.DeleteAccountConfirmDialogClick(it),
-                        )
-                    }
-                },
-                onDeleteAccountClick = remember(viewModel) {
-                    { viewModel.trySendAction(DeleteAccountAction.DeleteAccountClick) }
-                },
-                isUnlockWithPasswordEnabled = state.isUnlockWithPasswordEnabled,
-                modifier = Modifier
-                    .testTag("DELETE ACCOUNT")
-                    .fillMaxWidth()
-                    .padding(horizontal = 16.dp),
-            )
-            Spacer(modifier = Modifier.height(12.dp))
-            BitwardenOutlinedErrorButton(
-                label = stringResource(id = R.string.cancel),
-                onClick = remember(viewModel) {
-                    { viewModel.trySendAction(DeleteAccountAction.CancelClick) }
-                },
-                modifier = Modifier
-                    .testTag("CANCEL")
-                    .fillMaxWidth()
-                    .padding(horizontal = 16.dp),
-            )
-            Spacer(modifier = Modifier.navigationBarsPadding())
+            Spacer(modifier = Modifier.height(16.dp))
+            if (state.isUserManagedByOrganization) {
+                WarningMessageCard(
+                    headerText = stringResource(id = R.string.cannot_delete_your_account),
+                    subtitleText = stringResource(
+                        id = R.string.cannot_delete_your_account_explanation,
+                    ),
+                    modifier = Modifier.standardHorizontalMargin(),
+                )
+            } else {
+                WarningMessageCard(
+                    headerText = stringResource(id = R.string.deleting_your_account_is_permanent),
+                    subtitleText = stringResource(id = R.string.delete_account_explanation),
+                    modifier = Modifier.standardHorizontalMargin(),
+                )
+                Spacer(modifier = Modifier.height(24.dp))
+                DeleteAccountButton(
+                    onDeleteAccountConfirmDialogClick = remember(viewModel) {
+                        {
+                            viewModel.trySendAction(
+                                DeleteAccountAction.DeleteAccountConfirmDialogClick(it),
+                            )
+                        }
+                    },
+                    onDeleteAccountClick = remember(viewModel) {
+                        { viewModel.trySendAction(DeleteAccountAction.DeleteAccountClick) }
+                    },
+                    isUnlockWithPasswordEnabled = state.isUnlockWithPasswordEnabled,
+                    modifier = Modifier
+                        .testTag("DELETE ACCOUNT")
+                        .fillMaxWidth()
+                        .padding(horizontal = 16.dp),
+                )
+                Spacer(modifier = Modifier.height(12.dp))
+                BitwardenOutlinedErrorButton(
+                    label = stringResource(id = R.string.cancel),
+                    onClick = remember(viewModel) {
+                        { viewModel.trySendAction(DeleteAccountAction.CancelClick) }
+                    },
+                    modifier = Modifier
+                        .testTag("CANCEL")
+                        .fillMaxWidth()
+                        .padding(horizontal = 16.dp),
+                )
+                Spacer(modifier = Modifier.navigationBarsPadding())
+            }
         }
     }
 }
@@ -204,3 +202,50 @@ private fun DeleteAccountButton(
         modifier = modifier,
     )
 }
+
+@Composable
+private fun WarningMessageCard(
+    headerText: String,
+    subtitleText: String,
+    modifier: Modifier = Modifier,
+) {
+    Row(
+        modifier = modifier.cardStyle(
+            cardStyle = CardStyle.Full,
+            paddingHorizontal = 12.dp,
+        ),
+        verticalAlignment = Alignment.CenterVertically,
+    ) {
+        Icon(
+            painter = rememberVectorPainter(id = R.drawable.ic_warning),
+            contentDescription = null,
+            tint = BitwardenTheme.colorScheme.status.weak1,
+        )
+        Spacer(Modifier.width(width = 12.dp))
+        Column(modifier = Modifier.weight(weight = 1f)) {
+            Text(
+                text = headerText,
+                style = BitwardenTheme.typography.titleSmall,
+                color = BitwardenTheme.colorScheme.status.weak1,
+                modifier = Modifier.fillMaxWidth(),
+            )
+            Spacer(modifier = Modifier.height(height = 4.dp))
+            Text(
+                text = subtitleText,
+                style = BitwardenTheme.typography.bodyMedium,
+                color = BitwardenTheme.colorScheme.text.secondary,
+                modifier = Modifier.fillMaxWidth(),
+            )
+        }
+        Spacer(modifier = Modifier.width(width = 4.dp))
+    }
+}
+
+@Preview
+@Composable
+private fun WarningMessageCard_preview() {
+    WarningMessageCard(
+        headerText = stringResource(id = R.string.cannot_delete_your_account),
+        subtitleText = stringResource(id = R.string.cannot_delete_your_account_explanation),
+    )
+}
diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountViewModel.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountViewModel.kt
index 0ee7565154d..4b4606110c7 100644
--- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountViewModel.kt
+++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountViewModel.kt
@@ -3,13 +3,13 @@ package com.x8bit.bitwarden.ui.platform.feature.settings.accountsecurity.deletea
 import android.os.Parcelable
 import androidx.lifecycle.SavedStateHandle
 import androidx.lifecycle.viewModelScope
+import com.bitwarden.ui.util.Text
+import com.bitwarden.ui.util.asText
 import com.x8bit.bitwarden.R
 import com.x8bit.bitwarden.data.auth.repository.AuthRepository
 import com.x8bit.bitwarden.data.auth.repository.model.DeleteAccountResult
 import com.x8bit.bitwarden.data.auth.repository.model.ValidatePasswordResult
 import com.x8bit.bitwarden.ui.platform.base.BaseViewModel
-import com.bitwarden.ui.util.Text
-import com.bitwarden.ui.util.asText
 import dagger.hilt.android.lifecycle.HiltViewModel
 import kotlinx.coroutines.delay
 import kotlinx.coroutines.flow.launchIn
@@ -32,12 +32,16 @@ class DeleteAccountViewModel @Inject constructor(
     private val authRepository: AuthRepository,
     savedStateHandle: SavedStateHandle,
 ) : BaseViewModel<DeleteAccountState, DeleteAccountEvent, DeleteAccountAction>(
-    initialState = savedStateHandle[KEY_STATE] ?: DeleteAccountState(
-        dialog = null,
-        isUnlockWithPasswordEnabled = requireNotNull(authRepository.userStateFlow.value)
-            .activeAccount
-            .hasMasterPassword,
-    ),
+    initialState = savedStateHandle[KEY_STATE] ?: run {
+        val account = requireNotNull(authRepository.userStateFlow.value).activeAccount
+        DeleteAccountState(
+            dialog = null,
+            isUnlockWithPasswordEnabled = account.hasMasterPassword,
+            isUserManagedByOrganization = account
+                .organizations
+                .any { it.userIsClaimedByOrganization } == true,
+        )
+    },
 ) {
 
     init {
@@ -160,11 +164,13 @@ class DeleteAccountViewModel @Inject constructor(
  * @param dialog The dialog for the [DeleteAccountScreen].
  * @param isUnlockWithPasswordEnabled Whether or not the user is able to unlock the vault with
  * their master password.
+ * @param isUserManagedByOrganization Whether or not the user is managed by an organization.
  */
 @Parcelize
 data class DeleteAccountState(
     val dialog: DeleteAccountDialog?,
     val isUnlockWithPasswordEnabled: Boolean,
+    val isUserManagedByOrganization: Boolean,
 ) : Parcelable {
 
     /**
diff --git a/app/src/main/res/drawable/ic_warning.xml b/app/src/main/res/drawable/ic_warning.xml
index bb708159b26..f01c0627912 100644
--- a/app/src/main/res/drawable/ic_warning.xml
+++ b/app/src/main/res/drawable/ic_warning.xml
@@ -1,20 +1,16 @@
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:width="28dp"
-    android:height="28dp"
-    android:viewportHeight="28"
-    android:viewportWidth="28">
-    <group>
-        <clip-path android:pathData="M0.667,0.667h26.667v26.667h-26.667z" />
-        <path
-            android:fillColor="#BA1A1A"
-            android:fillType="evenOdd"
-            android:pathData="M16.036,3.434L26.957,20.361C28.069,22.083 26.646,24 24.921,24H3.079C1.354,24 -0.069,22.083 1.043,20.361L11.964,3.434C12.91,1.967 15.09,1.967 16.036,3.434ZM14.635,4.337C14.345,3.888 13.655,3.888 13.365,4.337L2.443,21.264C2.141,21.733 2.498,22.333 3.079,22.333H24.921C25.502,22.333 25.859,21.733 25.557,21.264L14.635,4.337Z" />
-        <path
-            android:fillColor="#BA1A1A"
-            android:fillType="evenOdd"
-            android:pathData="M14.001,9.499C14.461,9.499 14.834,9.872 14.834,10.332V15.528C14.834,15.989 14.461,16.362 14.001,16.362C13.541,16.362 13.168,15.989 13.168,15.528V10.332C13.168,9.872 13.541,9.499 14.001,9.499Z" />
-        <path
-            android:fillColor="#BA1A1A"
-            android:pathData="M15.126,19.785C15.126,20.406 14.622,20.91 14.001,20.91C13.38,20.91 12.876,20.406 12.876,19.785C12.876,19.163 13.38,18.66 14.001,18.66C14.622,18.66 15.126,19.163 15.126,19.785Z" />
-    </group>
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+  <path
+      android:pathData="M13.25,16.587C13.25,17.284 12.69,17.848 12,17.848C11.31,17.848 10.75,17.284 10.75,16.587C10.75,15.891 11.31,15.327 12,15.327C12.69,15.327 13.25,15.891 13.25,16.587Z"
+      android:fillColor="#CB263A"/>
+  <path
+      android:pathData="M11.003,9.023C10.703,9.023 10.47,9.286 10.507,9.584L11.008,13.627C11.039,13.878 11.252,14.066 11.504,14.066H12.496C12.748,14.066 12.961,13.878 12.992,13.627L13.493,9.584C13.53,9.286 13.297,9.023 12.997,9.023H11.003Z"
+      android:fillColor="#CB263A"/>
+  <path
+      android:pathData="M13.717,4C12.954,2.667 11.046,2.667 10.283,4L2.269,18C1.505,19.333 2.459,21 3.986,21H20.014C21.541,21 22.495,19.333 21.731,18L13.717,4ZM20.43,18.745L12.415,4.745C12.228,4.418 11.772,4.418 11.585,4.745L3.57,18.745C3.369,19.098 3.634,19.5 3.986,19.5H20.014C20.366,19.5 20.631,19.098 20.43,18.745Z"
+      android:fillColor="#CB263A"
+      android:fillType="evenOdd"/>
 </vector>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 30496e4e40b..21bf84c0a93 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1263,4 +1263,6 @@ Do you want to switch to this account?</string>
     <string name="a_certificate_with_the_alias_x_already_exists_do_you_want_to_replace_it">A certificate with this alias \"%s\" already exists. Do you want to replace it?\nReplace the certificate may impact your connection to any environments currently using it.</string>
     <string name="replace_certificate">Replace certificate</string>
     <string name="unable_to_read_certificate">Unable to read certificate.</string>
+    <string name="cannot_delete_your_account">Cannot delete your account</string>
+    <string name="cannot_delete_your_account_explanation">This action cannot be completed because your account is owned by an organization. Contact your organization administrator for additional details.</string>
 </resources>
diff --git a/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryTest.kt b/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryTest.kt
index 0e018a12ef9..0cc10b53be5 100644
--- a/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryTest.kt
+++ b/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryTest.kt
@@ -4679,6 +4679,7 @@ class AuthRepositoryTest {
                 every { shouldUseKeyConnector } returns true
                 every { type } returns OrganizationType.USER
                 every { keyConnectorUrl } returns null
+                every { userIsClaimedByOrganization } returns false
             },
         )
         fakeAuthDiskSource.storeOrganizations(userId = USER_ID_1, organizations = organizations)
@@ -4708,6 +4709,7 @@ class AuthRepositoryTest {
                     every { shouldUseKeyConnector } returns true
                     every { type } returns OrganizationType.USER
                     every { keyConnectorUrl } returns url
+                    every { userIsClaimedByOrganization } returns false
                 },
             )
             fakeAuthDiskSource.storeOrganizations(userId = USER_ID_1, organizations = organizations)
@@ -4745,6 +4747,7 @@ class AuthRepositoryTest {
                     every { shouldUseKeyConnector } returns true
                     every { type } returns OrganizationType.USER
                     every { keyConnectorUrl } returns url
+                    every { userIsClaimedByOrganization } returns false
                 },
             )
             fakeAuthDiskSource.storeOrganizations(userId = USER_ID_1, organizations = organizations)
@@ -4785,6 +4788,7 @@ class AuthRepositoryTest {
                     every { shouldUseKeyConnector } returns true
                     every { type } returns OrganizationType.USER
                     every { keyConnectorUrl } returns url
+                    every { userIsClaimedByOrganization } returns false
                 },
             )
             fakeAuthDiskSource.storeOrganizations(userId = USER_ID_1, organizations = organizations)
@@ -4824,6 +4828,7 @@ class AuthRepositoryTest {
                     every { shouldUseKeyConnector } returns true
                     every { type } returns OrganizationType.USER
                     every { keyConnectorUrl } returns url
+                    every { userIsClaimedByOrganization } returns false
                 },
             )
             fakeAuthDiskSource.storeOrganizations(userId = USER_ID_1, organizations = organizations)
@@ -6887,6 +6892,42 @@ class AuthRepositoryTest {
             )
         }
 
+    @Suppress("MaxLineLength")
+    @Test
+    fun `isUserManagedByOrganization should return true if any org userIsClaimedByOrganization is true`() =
+        runTest {
+            fakeAuthDiskSource.userState = SINGLE_USER_STATE_1
+            fakeAuthDiskSource.storeUserKey(userId = USER_ID_1, userKey = ENCRYPTED_USER_KEY)
+            val organizations = listOf(
+                createMockOrganization(number = 0)
+                    .copy(
+                        userIsClaimedByOrganization = true,
+                    ),
+                createMockOrganization(number = 1),
+            )
+            fakeAuthDiskSource.storeOrganizations(userId = USER_ID_1, organizations = organizations)
+            assertEquals(
+                SINGLE_USER_STATE_1.toUserState(
+                    vaultState = VAULT_UNLOCK_DATA,
+                    userAccountTokens = emptyList(),
+                    userOrganizationsList = listOf(
+                        UserOrganizations(
+                            userId = USER_ID_1,
+                            organizations = organizations.toOrganizations(),
+                        ),
+                    ),
+                    userIsUsingKeyConnectorList = emptyList(),
+                    hasPendingAccountAddition = false,
+                    onboardingStatus = null,
+                    isBiometricsEnabledProvider = { false },
+                    vaultUnlockTypeProvider = { VaultUnlockType.MASTER_PASSWORD },
+                    isDeviceTrustedProvider = { false },
+                    firstTimeState = FIRST_TIME_STATE,
+                ),
+                repository.userStateFlow.value,
+            )
+        }
+
     companion object {
         private const val UNIQUE_APP_ID = "testUniqueAppId"
         private const val NAME = "Example Name"
diff --git a/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/util/AuthDiskSourceExtensionsTest.kt b/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/util/AuthDiskSourceExtensionsTest.kt
index c94240b0c6a..2b9da936209 100644
--- a/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/util/AuthDiskSourceExtensionsTest.kt
+++ b/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/util/AuthDiskSourceExtensionsTest.kt
@@ -195,6 +195,7 @@ class AuthDiskSourceExtensionsTest {
                             shouldUseKeyConnector = false,
                             role = OrganizationType.ADMIN,
                             keyConnectorUrl = "mockKeyConnectorUrl-1",
+                            userIsClaimedByOrganization = false,
                         ),
                     ),
                 ),
@@ -208,6 +209,7 @@ class AuthDiskSourceExtensionsTest {
                             shouldUseKeyConnector = false,
                             role = OrganizationType.ADMIN,
                             keyConnectorUrl = "mockKeyConnectorUrl-2",
+                            userIsClaimedByOrganization = false,
                         ),
                     ),
                 ),
@@ -221,6 +223,7 @@ class AuthDiskSourceExtensionsTest {
                             shouldUseKeyConnector = false,
                             role = OrganizationType.ADMIN,
                             keyConnectorUrl = "mockKeyConnectorUrl-3",
+                            userIsClaimedByOrganization = false,
                         ),
                     ),
                 ),
@@ -369,6 +372,7 @@ class AuthDiskSourceExtensionsTest {
                                     shouldUseKeyConnector = false,
                                     role = OrganizationType.ADMIN,
                                     keyConnectorUrl = "mockKeyConnectorUrl-1",
+                                    userIsClaimedByOrganization = false,
                                 ),
                             ),
                         ),
@@ -401,6 +405,7 @@ class AuthDiskSourceExtensionsTest {
                                     shouldUseKeyConnector = false,
                                     role = OrganizationType.ADMIN,
                                     keyConnectorUrl = "mockKeyConnectorUrl-1",
+                                    userIsClaimedByOrganization = false,
                                 ),
                             ),
                         ),
@@ -414,6 +419,7 @@ class AuthDiskSourceExtensionsTest {
                                     shouldUseKeyConnector = false,
                                     role = OrganizationType.ADMIN,
                                     keyConnectorUrl = "mockKeyConnectorUrl-2",
+                                    userIsClaimedByOrganization = false,
                                 ),
                             ),
                         ),
diff --git a/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/util/SyncResponseJsonExtensionsTest.kt b/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/util/SyncResponseJsonExtensionsTest.kt
index 7d2590388d9..a6edd684741 100644
--- a/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/util/SyncResponseJsonExtensionsTest.kt
+++ b/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/util/SyncResponseJsonExtensionsTest.kt
@@ -24,6 +24,7 @@ class SyncResponseJsonExtensionsTest {
                 shouldUseKeyConnector = false,
                 role = OrganizationType.ADMIN,
                 keyConnectorUrl = "mockKeyConnectorUrl-1",
+                userIsClaimedByOrganization = false,
             ),
             createMockOrganization(number = 1).toOrganization(),
         )
@@ -40,6 +41,7 @@ class SyncResponseJsonExtensionsTest {
                     shouldUseKeyConnector = true,
                     role = OrganizationType.ADMIN,
                     keyConnectorUrl = "mockKeyConnectorUrl-1",
+                    userIsClaimedByOrganization = false,
                 ),
                 Organization(
                     id = "mockId-2",
@@ -48,6 +50,7 @@ class SyncResponseJsonExtensionsTest {
                     shouldUseKeyConnector = false,
                     role = OrganizationType.USER,
                     keyConnectorUrl = "mockKeyConnectorUrl-2",
+                    userIsClaimedByOrganization = false,
                 ),
             ),
             listOf(
diff --git a/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensionsTest.kt b/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensionsTest.kt
index 4bc0d17a987..04b5dac9eee 100644
--- a/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensionsTest.kt
+++ b/app/src/test/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensionsTest.kt
@@ -367,6 +367,7 @@ class UserStateJsonExtensionsTest {
                                 shouldUseKeyConnector = false,
                                 role = OrganizationType.ADMIN,
                                 keyConnectorUrl = null,
+                                userIsClaimedByOrganization = false,
                             ),
                         ),
                         isBiometricsEnabled = false,
@@ -432,6 +433,7 @@ class UserStateJsonExtensionsTest {
                                     shouldUseKeyConnector = false,
                                     role = OrganizationType.ADMIN,
                                     keyConnectorUrl = null,
+                                    userIsClaimedByOrganization = false,
                                 ),
                             ),
                         ),
@@ -477,6 +479,7 @@ class UserStateJsonExtensionsTest {
                                 shouldUseKeyConnector = false,
                                 role = OrganizationType.ADMIN,
                                 keyConnectorUrl = null,
+                                userIsClaimedByOrganization = false,
                             ),
                         ),
                         isBiometricsEnabled = true,
@@ -538,6 +541,7 @@ class UserStateJsonExtensionsTest {
                                     shouldUseKeyConnector = false,
                                     role = OrganizationType.ADMIN,
                                     keyConnectorUrl = null,
+                                    userIsClaimedByOrganization = false,
                                 ),
                             ),
                         ),
@@ -584,6 +588,7 @@ class UserStateJsonExtensionsTest {
                                 shouldUseKeyConnector = false,
                                 role = OrganizationType.ADMIN,
                                 keyConnectorUrl = null,
+                                userIsClaimedByOrganization = false,
                             ),
                         ),
                         isBiometricsEnabled = false,
@@ -653,6 +658,7 @@ class UserStateJsonExtensionsTest {
                                     shouldUseKeyConnector = false,
                                     role = OrganizationType.ADMIN,
                                     keyConnectorUrl = null,
+                                    userIsClaimedByOrganization = false,
                                 ),
                             ),
                         ),
@@ -699,6 +705,7 @@ class UserStateJsonExtensionsTest {
                                 shouldUseKeyConnector = false,
                                 role = OrganizationType.ADMIN,
                                 keyConnectorUrl = null,
+                                userIsClaimedByOrganization = false,
                             ),
                         ),
                         isBiometricsEnabled = false,
@@ -768,6 +775,7 @@ class UserStateJsonExtensionsTest {
                                     shouldUseKeyConnector = false,
                                     role = OrganizationType.ADMIN,
                                     keyConnectorUrl = null,
+                                    userIsClaimedByOrganization = false,
                                 ),
                             ),
                         ),
@@ -814,6 +822,7 @@ class UserStateJsonExtensionsTest {
                                 shouldUseKeyConnector = false,
                                 role = OrganizationType.ADMIN,
                                 keyConnectorUrl = null,
+                                userIsClaimedByOrganization = false,
                             ),
                         ),
                         isBiometricsEnabled = false,
@@ -883,6 +892,7 @@ class UserStateJsonExtensionsTest {
                                     shouldUseKeyConnector = false,
                                     role = OrganizationType.ADMIN,
                                     keyConnectorUrl = null,
+                                    userIsClaimedByOrganization = false,
                                 ),
                             ),
                         ),
@@ -930,6 +940,7 @@ class UserStateJsonExtensionsTest {
                                 shouldUseKeyConnector = false,
                                 role = OrganizationType.USER,
                                 keyConnectorUrl = null,
+                                userIsClaimedByOrganization = false,
                             ),
                         ),
                         isBiometricsEnabled = false,
@@ -1002,6 +1013,7 @@ class UserStateJsonExtensionsTest {
                                     shouldUseKeyConnector = false,
                                     role = OrganizationType.USER,
                                     keyConnectorUrl = null,
+                                    userIsClaimedByOrganization = false,
                                 ),
                             ),
                         ),
@@ -1207,6 +1219,7 @@ class UserStateJsonExtensionsTest {
                                 shouldUseKeyConnector = false,
                                 role = OrganizationType.USER,
                                 keyConnectorUrl = null,
+                                userIsClaimedByOrganization = false,
                             ),
                         ),
                         isBiometricsEnabled = false,
@@ -1278,6 +1291,7 @@ class UserStateJsonExtensionsTest {
                                     shouldUseKeyConnector = false,
                                     role = OrganizationType.USER,
                                     keyConnectorUrl = null,
+                                    userIsClaimedByOrganization = false,
                                 ),
                             ),
                         ),
@@ -1324,6 +1338,7 @@ class UserStateJsonExtensionsTest {
                                 shouldUseKeyConnector = false,
                                 role = OrganizationType.ADMIN,
                                 keyConnectorUrl = null,
+                                userIsClaimedByOrganization = false,
                             ),
                         ),
                         isBiometricsEnabled = false,
@@ -1395,6 +1410,7 @@ class UserStateJsonExtensionsTest {
                                     shouldUseKeyConnector = false,
                                     role = OrganizationType.ADMIN,
                                     keyConnectorUrl = null,
+                                    userIsClaimedByOrganization = false,
                                 ),
                             ),
                         ),
diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/removepassword/RemovePasswordViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/removepassword/RemovePasswordViewModelTest.kt
index f44fd777356..0fa70c1c01b 100644
--- a/app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/removepassword/RemovePasswordViewModelTest.kt
+++ b/app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/removepassword/RemovePasswordViewModelTest.kt
@@ -295,6 +295,7 @@ private val DEFAULT_ACCOUNT = UserState.Account(
             shouldUseKeyConnector = true,
             role = OrganizationType.USER,
             keyConnectorUrl = KEY_CONNECTOR_URL,
+            userIsClaimedByOrganization = false,
         ),
     ),
     needsMasterPassword = false,
diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModelTest.kt
index 8e2a76e3c72..739d9166f0c 100644
--- a/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModelTest.kt
+++ b/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavViewModelTest.kt
@@ -387,6 +387,7 @@ class RootNavViewModelTest : BaseViewModelTest() {
                                 shouldUseKeyConnector = true,
                                 role = OrganizationType.USER,
                                 keyConnectorUrl = "bitwarden.com",
+                                userIsClaimedByOrganization = false,
                             ),
                         ),
                         needsMasterPassword = false,
diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/AccountSecurityViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/AccountSecurityViewModelTest.kt
index 8b546a721fb..c8ab3a0e875 100644
--- a/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/AccountSecurityViewModelTest.kt
+++ b/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/AccountSecurityViewModelTest.kt
@@ -998,6 +998,7 @@ private val DEFAULT_USER_STATE = UserState(
                     shouldManageResetPassword = false,
                     role = OrganizationType.USER,
                     keyConnectorUrl = null,
+                    userIsClaimedByOrganization = false,
                 ),
                 Organization(
                     id = "organizationAdmin",
@@ -1006,6 +1007,7 @@ private val DEFAULT_USER_STATE = UserState(
                     shouldManageResetPassword = false,
                     role = OrganizationType.ADMIN,
                     keyConnectorUrl = null,
+                    userIsClaimedByOrganization = false,
                 ),
                 Organization(
                     id = "organizationOwner",
@@ -1014,6 +1016,7 @@ private val DEFAULT_USER_STATE = UserState(
                     shouldManageResetPassword = false,
                     role = OrganizationType.OWNER,
                     keyConnectorUrl = null,
+                    userIsClaimedByOrganization = false,
                 ),
                 Organization(
                     id = "organizationCustom",
@@ -1022,6 +1025,7 @@ private val DEFAULT_USER_STATE = UserState(
                     shouldManageResetPassword = false,
                     role = OrganizationType.CUSTOM,
                     keyConnectorUrl = null,
+                    userIsClaimedByOrganization = false,
                 ),
             ),
             needsMasterPassword = false,
diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountScreenTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountScreenTest.kt
index 2fcfd93e739..07eaf8b02b0 100644
--- a/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountScreenTest.kt
+++ b/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountScreenTest.kt
@@ -214,9 +214,48 @@ class DeleteAccountScreenTest : BaseComposeTest() {
             )
         }
     }
+
+    @Suppress("MaxLineLength")
+    @Test
+    fun `if isUserManagedByOrganization should display cannot delete message and hide delete button`() {
+        composeTestRule
+            .onNodeWithText("Cannot delete your account")
+            .assertDoesNotExist()
+
+        composeTestRule
+            .onNodeWithText("This action cannot be completed because your account " +
+                "is owned by an organization. " +
+                "Contact your organization administrator for additional details.")
+            .assertDoesNotExist()
+
+        composeTestRule
+            .onAllNodesWithText("Delete account")
+            .filterToOne(hasClickAction())
+            .assertExists()
+
+        mutableStateFlow.update {
+            it.copy(isUserManagedByOrganization = true)
+        }
+
+        composeTestRule
+            .onNodeWithText("Cannot delete your account")
+            .assertExists()
+
+        composeTestRule
+            .onNodeWithText("This action cannot be completed because your account " +
+                "is owned by an organization. " +
+                "Contact your organization administrator for additional details.")
+            .assertExists()
+
+        composeTestRule
+            .onAllNodesWithText("Delete account")
+            .filterToOne(hasClickAction())
+            .assertDoesNotExist()
+    }
 }
 
 private val DEFAULT_STATE: DeleteAccountState = DeleteAccountState(
     dialog = null,
     isUnlockWithPasswordEnabled = true,
+    isUserManagedByOrganization = false,
 )
diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountViewModelTest.kt
index 71452b3be82..6f873e8597a 100644
--- a/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountViewModelTest.kt
+++ b/app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountViewModelTest.kt
@@ -255,4 +255,5 @@ private val DEFAULT_USER_STATE: UserState = UserState(
 private val DEFAULT_STATE: DeleteAccountState = DeleteAccountState(
     dialog = null,
     isUnlockWithPasswordEnabled = true,
+    isUserManagedByOrganization = false,
 )
diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModelTest.kt
index 2c402fc346c..9795f6ec4a0 100644
--- a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModelTest.kt
+++ b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModelTest.kt
@@ -4619,6 +4619,7 @@ class VaultAddEditViewModelTest : BaseViewModelTest() {
                             shouldUseKeyConnector = false,
                             role = OrganizationType.ADMIN,
                             keyConnectorUrl = null,
+                            userIsClaimedByOrganization = false,
                         ),
                     ),
                     isBiometricsEnabled = true,
diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/util/CipherViewExtensionsTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/util/CipherViewExtensionsTest.kt
index 4bc97cc3432..9ea2ffe5c9b 100644
--- a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/util/CipherViewExtensionsTest.kt
+++ b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/addedit/util/CipherViewExtensionsTest.kt
@@ -565,6 +565,7 @@ class CipherViewExtensionsTest {
                     shouldUseKeyConnector = false,
                     role = OrganizationType.ADMIN,
                     keyConnectorUrl = null,
+                    userIsClaimedByOrganization = false,
                 ),
             ),
             isBiometricsEnabled = true,
diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModelTest.kt
index de364b02008..e1d3dd5be11 100644
--- a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModelTest.kt
+++ b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModelTest.kt
@@ -3350,6 +3350,7 @@ class VaultItemViewModelTest : BaseViewModelTest() {
                                 shouldUseKeyConnector = false,
                                 role = OrganizationType.OWNER,
                                 keyConnectorUrl = null,
+                                userIsClaimedByOrganization = false,
                             ),
                         ),
                     ),
diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/movetoorganization/VaultMoveToOrganizationViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/movetoorganization/VaultMoveToOrganizationViewModelTest.kt
index 21906fb6242..58b6b356f5b 100644
--- a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/movetoorganization/VaultMoveToOrganizationViewModelTest.kt
+++ b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/movetoorganization/VaultMoveToOrganizationViewModelTest.kt
@@ -499,6 +499,7 @@ private val DEFAULT_USER_STATE = UserState(
                     shouldUseKeyConnector = false,
                     role = OrganizationType.ADMIN,
                     keyConnectorUrl = null,
+                    userIsClaimedByOrganization = false,
                 ),
                 Organization(
                     id = "mockOrganizationId-2",
@@ -507,6 +508,7 @@ private val DEFAULT_USER_STATE = UserState(
                     shouldUseKeyConnector = false,
                     role = OrganizationType.ADMIN,
                     keyConnectorUrl = null,
+                    userIsClaimedByOrganization = false,
                 ),
                 Organization(
                     id = "mockOrganizationId-3",
@@ -515,6 +517,7 @@ private val DEFAULT_USER_STATE = UserState(
                     shouldUseKeyConnector = false,
                     role = OrganizationType.ADMIN,
                     keyConnectorUrl = null,
+                    userIsClaimedByOrganization = false,
                 ),
             ),
             trustedDevice = null,
diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/movetoorganization/util/VaultMoveToOrganizationExtensionsTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/movetoorganization/util/VaultMoveToOrganizationExtensionsTest.kt
index c5002751756..d781d8aa802 100644
--- a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/movetoorganization/util/VaultMoveToOrganizationExtensionsTest.kt
+++ b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/movetoorganization/util/VaultMoveToOrganizationExtensionsTest.kt
@@ -109,6 +109,7 @@ private fun createMockUserState(hasOrganizations: Boolean = true): UserState =
                             shouldUseKeyConnector = false,
                             role = OrganizationType.ADMIN,
                             keyConnectorUrl = null,
+                            userIsClaimedByOrganization = false,
                         ),
                         Organization(
                             id = "mockOrganizationId-2",
@@ -117,6 +118,7 @@ private fun createMockUserState(hasOrganizations: Boolean = true): UserState =
                             shouldUseKeyConnector = false,
                             role = OrganizationType.ADMIN,
                             keyConnectorUrl = null,
+                            userIsClaimedByOrganization = false,
                         ),
                         Organization(
                             id = "mockOrganizationId-3",
@@ -125,6 +127,7 @@ private fun createMockUserState(hasOrganizations: Boolean = true): UserState =
                             shouldUseKeyConnector = false,
                             role = OrganizationType.ADMIN,
                             keyConnectorUrl = null,
+                            userIsClaimedByOrganization = false,
                         ),
                     )
                 } else {
diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModelTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModelTest.kt
index 055ba941103..0820e457ac9 100644
--- a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModelTest.kt
+++ b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultViewModelTest.kt
@@ -259,6 +259,7 @@ class VaultViewModelTest : BaseViewModelTest() {
                                 shouldUseKeyConnector = false,
                                 role = OrganizationType.ADMIN,
                                 keyConnectorUrl = null,
+                                userIsClaimedByOrganization = false,
                             ),
                         ),
                         trustedDevice = null,
@@ -346,6 +347,7 @@ class VaultViewModelTest : BaseViewModelTest() {
                                 shouldUseKeyConnector = false,
                                 role = OrganizationType.ADMIN,
                                 keyConnectorUrl = null,
+                                userIsClaimedByOrganization = false,
                             ),
                         ),
                         trustedDevice = null,
@@ -634,6 +636,7 @@ class VaultViewModelTest : BaseViewModelTest() {
                                 shouldUseKeyConnector = false,
                                 role = OrganizationType.ADMIN,
                                 keyConnectorUrl = null,
+                                userIsClaimedByOrganization = false,
                             ),
                         ),
                     ),
diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/vault/util/UserStateExtensionsTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/vault/util/UserStateExtensionsTest.kt
index dd019989622..513493b6228 100644
--- a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/vault/util/UserStateExtensionsTest.kt
+++ b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/vault/util/UserStateExtensionsTest.kt
@@ -83,6 +83,7 @@ class UserStateExtensionsTest {
                                 shouldUseKeyConnector = false,
                                 role = OrganizationType.ADMIN,
                                 keyConnectorUrl = null,
+                                userIsClaimedByOrganization = false,
                             ),
                         ),
                         trustedDevice = null,
@@ -111,6 +112,7 @@ class UserStateExtensionsTest {
                                 shouldUseKeyConnector = false,
                                 role = OrganizationType.ADMIN,
                                 keyConnectorUrl = null,
+                                userIsClaimedByOrganization = false,
                             ),
                         ),
                         trustedDevice = null,
@@ -143,6 +145,7 @@ class UserStateExtensionsTest {
                                 shouldUseKeyConnector = false,
                                 role = OrganizationType.ADMIN,
                                 keyConnectorUrl = null,
+                                userIsClaimedByOrganization = false,
                             ),
                         ),
                         trustedDevice = null,
@@ -175,6 +178,7 @@ class UserStateExtensionsTest {
                                 shouldUseKeyConnector = false,
                                 role = OrganizationType.ADMIN,
                                 keyConnectorUrl = null,
+                                userIsClaimedByOrganization = false,
                             ),
                         ),
                         trustedDevice = null,
@@ -222,6 +226,7 @@ class UserStateExtensionsTest {
                         shouldUseKeyConnector = false,
                         role = OrganizationType.ADMIN,
                         keyConnectorUrl = null,
+                        userIsClaimedByOrganization = false,
                     ),
                 ),
                 trustedDevice = null,
@@ -267,6 +272,7 @@ class UserStateExtensionsTest {
                         shouldUseKeyConnector = false,
                         role = OrganizationType.ADMIN,
                         keyConnectorUrl = null,
+                        userIsClaimedByOrganization = false,
                     ),
                 ),
                 trustedDevice = null,
@@ -316,6 +322,7 @@ class UserStateExtensionsTest {
                                 shouldUseKeyConnector = false,
                                 role = OrganizationType.ADMIN,
                                 keyConnectorUrl = null,
+                                userIsClaimedByOrganization = false,
                             ),
                         ),
                         trustedDevice = null,
@@ -395,6 +402,7 @@ class UserStateExtensionsTest {
                         shouldManageResetPassword = false,
                         role = OrganizationType.ADMIN,
                         keyConnectorUrl = null,
+                        userIsClaimedByOrganization = false,
                     ),
                     Organization(
                         id = "organizationId-A",
@@ -403,6 +411,7 @@ class UserStateExtensionsTest {
                         shouldUseKeyConnector = false,
                         role = OrganizationType.ADMIN,
                         keyConnectorUrl = null,
+                        userIsClaimedByOrganization = false,
                     ),
                 ),
                 trustedDevice = null,
@@ -455,6 +464,7 @@ class UserStateExtensionsTest {
                         shouldUseKeyConnector = false,
                         role = OrganizationType.ADMIN,
                         keyConnectorUrl = null,
+                        userIsClaimedByOrganization = false,
                     ),
                     Organization(
                         id = "organizationId-A",
@@ -463,6 +473,7 @@ class UserStateExtensionsTest {
                         shouldUseKeyConnector = false,
                         role = OrganizationType.ADMIN,
                         keyConnectorUrl = null,
+                        userIsClaimedByOrganization = false,
                     ),
                 ),
                 trustedDevice = null,
diff --git a/network/src/main/kotlin/com/bitwarden/network/model/SyncResponseJson.kt b/network/src/main/kotlin/com/bitwarden/network/model/SyncResponseJson.kt
index 2295ba2a7bf..2deb1038722 100644
--- a/network/src/main/kotlin/com/bitwarden/network/model/SyncResponseJson.kt
+++ b/network/src/main/kotlin/com/bitwarden/network/model/SyncResponseJson.kt
@@ -344,6 +344,9 @@ data class SyncResponseJson(
 
             @SerialName("status")
             val status: OrganizationStatusType,
+
+            @SerialName("userIsClaimedByOrganization")
+            val userIsClaimedByOrganization: Boolean,
         )
 
         /**
diff --git a/network/src/test/kotlin/com/bitwarden/network/service/SyncServiceTest.kt b/network/src/test/kotlin/com/bitwarden/network/service/SyncServiceTest.kt
index b6df3985216..e7a05113883 100644
--- a/network/src/test/kotlin/com/bitwarden/network/service/SyncServiceTest.kt
+++ b/network/src/test/kotlin/com/bitwarden/network/service/SyncServiceTest.kt
@@ -101,7 +101,8 @@ private const val SYNC_SUCCESS_JSON = """
         "name": "mockName-1",
         "useApi": false,
         "familySponsorshipValidUntil": "2023-10-27T12:00:00.00Z",
-        "status": 1
+        "status": 1,
+        "userIsClaimedByOrganization": false
       }
     ],
     "providers": [
@@ -176,7 +177,8 @@ private const val SYNC_SUCCESS_JSON = """
         "name": "mockName-1",
         "useApi": false,
         "familySponsorshipValidUntil": "2023-10-27T12:00:00.00Z",
-        "status": 1
+        "status": 1,
+        "userIsClaimedByOrganization": false
       }
     ]
   },
diff --git a/network/src/testFixtures/kotlin/com/bitwarden/network/model/SyncResponseProfileUtil.kt b/network/src/testFixtures/kotlin/com/bitwarden/network/model/SyncResponseProfileUtil.kt
index 75a0b8b067b..ebdf0b3d9b3 100644
--- a/network/src/testFixtures/kotlin/com/bitwarden/network/model/SyncResponseProfileUtil.kt
+++ b/network/src/testFixtures/kotlin/com/bitwarden/network/model/SyncResponseProfileUtil.kt
@@ -69,6 +69,7 @@ fun createMockOrganization(
         shouldUseApi = false,
         familySponsorshipValidUntil = ZonedDateTime.parse("2023-10-27T12:00:00Z"),
         status = OrganizationStatusType.ACCEPTED,
+        userIsClaimedByOrganization = false,
     )
 
 /**


Reviews:
user: login: david-livefront
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-01T15:56:54Z
user: login: david-livefront
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-01T16:00:47Z
user: login: david-livefront
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-01T16:05:13Z
user: login: david-livefront
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-01T21:02:31Z
user: login: david-livefront
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-01T21:02:47Z
user: login: aj-rosado
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-01T21:37:23Z
user: login: david-livefront
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-02T14:23:24Z
user: login: david-livefront
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-02T14:24:11Z
user: login: david-livefront
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-02T17:44:45Z
user: login: david-livefront
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-02T17:44:58Z
user: login: david-livefront
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-02T17:45:13Z
user: login: david-livefront
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-02T17:46:11Z
user: login: david-livefront
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-02T17:46:31Z
user: login: david-livefront
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-02T17:47:32Z
user: login: david-livefront
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-02T17:48:29Z
user: login: david-livefront
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-02T17:56:02Z
user: login: david-livefront
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-02T20:13:08Z
user: login: david-livefront
body: Looks great @aj-rosado!
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-05-02T20:19:13Z

Review comments:
diff_hunk: @@ -1263,4 +1263,6 @@ Do you want to switch to this account?</string>
     <string name="a_certificate_with_the_alias_x_already_exists_do_you_want_to_replace_it">A certificate with this alias \"%s\" already exists. Do you want to replace it?\nReplace the certificate may impact your connection to any environments currently using it.</string>
     <string name="replace_certificate">Replace certificate</string>
     <string name="unable_to_read_certificate">Unable to read certificate.</string>
-</resources>
+    <string name="cannot_delete_your_account">Cannot delete your account</string>
+    <string name="cannot_delete_your_account_explanation">This action cannot be completed because your account is owned by an organization. Contact your organization administrator for additional details.</string>
+</resources>
path: app/src/main/res/values/strings.xml
user: login: david-livefront
body: Can we keep the trailing newline
created_at: 2025-05-01T15:56:54Z
author_association: COLLABORATOR
diff_hunk: @@ -324,6 +325,7 @@ class AuthRepositoryImpl(
                     userIsUsingKeyConnectorList = authDiskSource.userKeyConnectorStateList,
                     hasPendingAccountAddition = mutableHasPendingAccountAdditionStateFlow.value,
                     onboardingStatus = authDiskSource.currentOnboardingStatus,
+                    userIsClaimedByOrganization = ::isUserManagedByOrganization,
path: app/src/main/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryImpl.kt
user: login: david-livefront
body: Can we just add this to the `UserOrganization` data? We already observe the organizations and pass in the required data, this can be part of that.
created_at: 2025-05-01T16:00:47Z
author_association: COLLABORATOR
diff_hunk: @@ -37,6 +37,9 @@ class DeleteAccountViewModel @Inject constructor(
         isUnlockWithPasswordEnabled = requireNotNull(authRepository.userStateFlow.value)
             .activeAccount
             .hasMasterPassword,
+        isUserManagedByOrganization = requireNotNull(authRepository.userStateFlow.value)
+            .activeAccount
+            .isClaimedByOrganization,
path: app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountViewModel.kt
user: login: david-livefront
body: Can we avoid the duplicate requireNotNull?

```kotlin
initialState = savedStateHandle[KEY_STATE] ?: run {
    val account = requireNotNull(authRepository.userStateFlow.value).activeAccount
    DeleteAccountState(
        dialog = null,
        isUnlockWithPasswordEnabled = account.hasMasterPassword,
        isUserManagedByOrganization = account.isClaimedByOrganization,
    )
}    
```
created_at: 2025-05-01T16:05:13Z
author_association: COLLABORATOR
diff_hunk: @@ -20,4 +20,5 @@ data class Organization(
     val shouldUseKeyConnector: Boolean,
     val role: OrganizationType,
     val keyConnectorUrl: String?,
+    val userIsClaimedByOrganization: Boolean,
path: app/src/main/java/com/x8bit/bitwarden/data/auth/repository/model/Organization.kt
user: login: david-livefront
body: Hmm, I meant the `UserOrganization` but I think this works equally as well.
🤔 
created_at: 2025-05-01T21:02:30Z
author_association: COLLABORATOR
diff_hunk: @@ -51,6 +51,7 @@ data class UserState(
      * not have a password but still not need one, such as TDE.
      * @property hasMasterPassword Indicates that the user does or does not have a master password.
      * @property organizations List of [Organization]s the user is associated with, if any.
+     * @property isClaimedByOrganization Indicates that the user is managed by an organization.
path: app/src/main/java/com/x8bit/bitwarden/data/auth/repository/model/UserState.kt
user: login: david-livefront
body: If we aren't adding this parameter, can we drop the doc here
created_at: 2025-05-01T21:02:46Z
author_association: COLLABORATOR
diff_hunk: @@ -20,4 +20,5 @@ data class Organization(
     val shouldUseKeyConnector: Boolean,
     val role: OrganizationType,
     val keyConnectorUrl: String?,
+    val userIsClaimedByOrganization: Boolean,
path: app/src/main/java/com/x8bit/bitwarden/data/auth/repository/model/Organization.kt
user: login: aj-rosado
body: I had been thinking about moving it to the `Organization` before opening the PR. So when I read your comment immediately thought of this class and not the one you actually mentioned.

If you think it suits better on the other class. I can move it
created_at: 2025-05-01T21:37:23Z
author_association: CONTRIBUTOR
diff_hunk: @@ -20,4 +20,5 @@ data class Organization(
     val shouldUseKeyConnector: Boolean,
     val role: OrganizationType,
     val keyConnectorUrl: String?,
+    val userIsClaimedByOrganization: Boolean,
path: app/src/main/java/com/x8bit/bitwarden/data/auth/repository/model/Organization.kt
user: login: david-livefront
body: I think what you have is fine
created_at: 2025-05-02T14:23:24Z
author_association: COLLABORATOR
diff_hunk: @@ -123,53 +123,73 @@ fun DeleteAccountScreen(
                 modifier = Modifier.padding(horizontal = 16.dp),
             )
             Spacer(modifier = Modifier.height(8.dp))
-            Text(
-                text = stringResource(id = R.string.deleting_your_account_is_permanent),
-                style = BitwardenTheme.typography.headlineSmall,
-                color = BitwardenTheme.colorScheme.status.error,
-                modifier = Modifier
-                    .fillMaxWidth()
-                    .padding(horizontal = 16.dp),
-            )
-            Spacer(modifier = Modifier.height(24.dp))
-            Text(
-                text = stringResource(id = R.string.delete_account_explanation),
-                style = BitwardenTheme.typography.bodyMedium,
-                color = BitwardenTheme.colorScheme.text.primary,
-                modifier = Modifier
-                    .fillMaxWidth()
-                    .padding(horizontal = 16.dp),
-            )
-            Spacer(modifier = Modifier.height(24.dp))
-            DeleteAccountButton(
-                onDeleteAccountConfirmDialogClick = remember(viewModel) {
-                    {
-                        viewModel.trySendAction(
-                            DeleteAccountAction.DeleteAccountConfirmDialogClick(it),
-                        )
-                    }
-                },
-                onDeleteAccountClick = remember(viewModel) {
-                    { viewModel.trySendAction(DeleteAccountAction.DeleteAccountClick) }
-                },
-                isUnlockWithPasswordEnabled = state.isUnlockWithPasswordEnabled,
-                modifier = Modifier
-                    .testTag("DELETE ACCOUNT")
-                    .fillMaxWidth()
-                    .padding(horizontal = 16.dp),
-            )
-            Spacer(modifier = Modifier.height(12.dp))
-            BitwardenOutlinedErrorButton(
-                label = stringResource(id = R.string.cancel),
-                onClick = remember(viewModel) {
-                    { viewModel.trySendAction(DeleteAccountAction.CancelClick) }
-                },
-                modifier = Modifier
-                    .testTag("CANCEL")
-                    .fillMaxWidth()
-                    .padding(horizontal = 16.dp),
-            )
-            Spacer(modifier = Modifier.navigationBarsPadding())
+            if (state.isUserManagedByOrganization) {
+                Text(
+                    text = stringResource(id = R.string.cannot_delete_your_account),
+                    style = BitwardenTheme.typography.headlineSmall,
+                    color = BitwardenTheme.colorScheme.status.error,
+                    modifier = Modifier
+                        .fillMaxWidth()
+                        .padding(horizontal = 16.dp),
+                )
+                Spacer(modifier = Modifier.height(24.dp))
+                Text(
+                    text = stringResource(id = R.string.cannot_delete_your_account_explanation),
+                    style = BitwardenTheme.typography.bodyMedium,
+                    color = BitwardenTheme.colorScheme.text.primary,
+                    modifier = Modifier
+                        .fillMaxWidth()
+                        .padding(horizontal = 16.dp),
path: app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountScreen.kt
user: login: david-livefront
body: Can we update this to match the designs here:

https://www.figma.com/design/WjD06w9dFlA67Ba27d1OSu/Dev-Ready--Bitwarden-Android?node-id=40001623-26994&t=BkbpLHG4N8LuXidT-4
created_at: 2025-05-02T14:24:11Z
author_association: COLLABORATOR
diff_hunk: @@ -204,3 +200,59 @@ private fun DeleteAccountButton(
         modifier = modifier,
     )
 }
+
+@Composable
+private fun WarningMessageCard(
+    headerText: String,
+    subtitleText: String,
+) {
+    Row(
+        modifier = Modifier
+            .standardHorizontalMargin()
+            .background(
+                BitwardenTheme.colorScheme.background.secondary,
+                shape = BitwardenTheme.shapes.actionCard,
+            ),
+        verticalAlignment = Alignment.CenterVertically,
+    ) {
+        Spacer(Modifier.width(12.dp))
+        Icon(
+            painter = rememberVectorPainter(id = R.drawable.ic_warning),
+            contentDescription = null,
+            tint = BitwardenTheme.colorScheme.status.error,
+        )
+
+        Column(modifier = Modifier.weight(weight = 1f, fill = false)) {
+            Spacer(Modifier.height(12.dp))
+            Text(
+                text = headerText,
+                style = BitwardenTheme.typography.titleSmall,
+                color = BitwardenTheme.colorScheme.status.error,
+                modifier = Modifier
+                    .fillMaxWidth()
+                    .padding(horizontal = 16.dp),
+            )
+            Spacer(Modifier.height(4.dp))
+            Text(
+                text = subtitleText,
+                style = BitwardenTheme.typography.bodyMedium,
+                color = BitwardenTheme.colorScheme.text.primary,
+                modifier = Modifier
+                    .fillMaxWidth()
+                    .padding(horizontal = 16.dp),
+            )
+            Spacer(Modifier.height(12.dp))
+        }
+    }
+}
+
+@Preview
+@Composable
+private fun WarningMessageCardPreview() {
path: app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountScreen.kt
user: login: david-livefront
body: The naming convention here should be `WarningMessageCard_preview`
created_at: 2025-05-02T17:44:45Z
author_association: COLLABORATOR
diff_hunk: @@ -204,3 +200,59 @@ private fun DeleteAccountButton(
         modifier = modifier,
     )
 }
+
+@Composable
+private fun WarningMessageCard(
+    headerText: String,
+    subtitleText: String,
+) {
+    Row(
+        modifier = Modifier
+            .standardHorizontalMargin()
+            .background(
+                BitwardenTheme.colorScheme.background.secondary,
+                shape = BitwardenTheme.shapes.actionCard,
+            ),
+        verticalAlignment = Alignment.CenterVertically,
+    ) {
+        Spacer(Modifier.width(12.dp))
+        Icon(
+            painter = rememberVectorPainter(id = R.drawable.ic_warning),
+            contentDescription = null,
+            tint = BitwardenTheme.colorScheme.status.error,
+        )
+
+        Column(modifier = Modifier.weight(weight = 1f, fill = false)) {
+            Spacer(Modifier.height(12.dp))
+            Text(
+                text = headerText,
+                style = BitwardenTheme.typography.titleSmall,
+                color = BitwardenTheme.colorScheme.status.error,
+                modifier = Modifier
+                    .fillMaxWidth()
+                    .padding(horizontal = 16.dp),
+            )
+            Spacer(Modifier.height(4.dp))
+            Text(
+                text = subtitleText,
+                style = BitwardenTheme.typography.bodyMedium,
+                color = BitwardenTheme.colorScheme.text.primary,
+                modifier = Modifier
+                    .fillMaxWidth()
+                    .padding(horizontal = 16.dp),
+            )
+            Spacer(Modifier.height(12.dp))
+        }
+    }
+}
+
+@Preview
+@Composable
+private fun WarningMessageCardPreview() {
+    Column {
path: app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountScreen.kt
user: login: david-livefront
body: You shouldn't need this column
created_at: 2025-05-02T17:44:58Z
author_association: COLLABORATOR
diff_hunk: @@ -204,3 +200,59 @@ private fun DeleteAccountButton(
         modifier = modifier,
     )
 }
+
+@Composable
+private fun WarningMessageCard(
+    headerText: String,
+    subtitleText: String,
path: app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountScreen.kt
user: login: david-livefront
body: This should take a modifier.
created_at: 2025-05-02T17:45:13Z
author_association: COLLABORATOR
diff_hunk: @@ -204,3 +200,59 @@ private fun DeleteAccountButton(
         modifier = modifier,
     )
 }
+
+@Composable
+private fun WarningMessageCard(
+    headerText: String,
+    subtitleText: String,
+) {
+    Row(
+        modifier = Modifier
+            .standardHorizontalMargin()
+            .background(
path: app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountScreen.kt
user: login: david-livefront
body: Can we use the card background extension. I am also seeing some spacing issues: I think it should be more like this:

```koltin
@Composable
private fun WarningMessageCard(
    headerText: String,
    subtitleText: String,
    modifier: Modifier = Modifier,
) {
    Row(
        modifier = modifier.cardStyle(
            cardStyle = CardStyle.Full,
            paddingHorizontal = 12.dp,
        ),
        verticalAlignment = Alignment.CenterVertically,
    ) {
        Icon(
            painter = rememberVectorPainter(id = R.drawable.ic_warning),
            contentDescription = null,
            tint = BitwardenTheme.colorScheme.status.weak1,
        )
        Spacer(Modifier.width(width = 12.dp))
        Column(modifier = Modifier.weight(weight = 1f)) {
            Text(
                text = headerText,
                style = BitwardenTheme.typography.titleSmall,
                color = BitwardenTheme.colorScheme.status.weak1,
                modifier = Modifier.fillMaxWidth(),
            )
            Spacer(modifier = Modifier.height(height = 4.dp))
            Text(
                text = subtitleText,
                style = BitwardenTheme.typography.bodyMedium,
                color = BitwardenTheme.colorScheme.text.secondary,
                modifier = Modifier.fillMaxWidth(),
            )
        }
        Spacer(modifier = Modifier.width(width = 4.dp))
    }
}
```
created_at: 2025-05-02T17:46:11Z
author_association: COLLABORATOR
diff_hunk: @@ -115,61 +121,51 @@ fun DeleteAccountScreen(
                 .fillMaxSize()
                 .verticalScroll(rememberScrollState()),
         ) {
-            Spacer(modifier = Modifier.height(8.dp))
-            Icon(
-                painter = rememberVectorPainter(id = R.drawable.ic_warning),
-                contentDescription = null,
-                tint = BitwardenTheme.colorScheme.status.error,
-                modifier = Modifier.padding(horizontal = 16.dp),
-            )
-            Spacer(modifier = Modifier.height(8.dp))
-            Text(
-                text = stringResource(id = R.string.deleting_your_account_is_permanent),
-                style = BitwardenTheme.typography.headlineSmall,
-                color = BitwardenTheme.colorScheme.status.error,
-                modifier = Modifier
-                    .fillMaxWidth()
-                    .padding(horizontal = 16.dp),
-            )
-            Spacer(modifier = Modifier.height(24.dp))
-            Text(
-                text = stringResource(id = R.string.delete_account_explanation),
-                style = BitwardenTheme.typography.bodyMedium,
-                color = BitwardenTheme.colorScheme.text.primary,
-                modifier = Modifier
-                    .fillMaxWidth()
-                    .padding(horizontal = 16.dp),
-            )
-            Spacer(modifier = Modifier.height(24.dp))
-            DeleteAccountButton(
-                onDeleteAccountConfirmDialogClick = remember(viewModel) {
-                    {
-                        viewModel.trySendAction(
-                            DeleteAccountAction.DeleteAccountConfirmDialogClick(it),
-                        )
-                    }
-                },
-                onDeleteAccountClick = remember(viewModel) {
-                    { viewModel.trySendAction(DeleteAccountAction.DeleteAccountClick) }
-                },
-                isUnlockWithPasswordEnabled = state.isUnlockWithPasswordEnabled,
-                modifier = Modifier
-                    .testTag("DELETE ACCOUNT")
-                    .fillMaxWidth()
-                    .padding(horizontal = 16.dp),
-            )
-            Spacer(modifier = Modifier.height(12.dp))
-            BitwardenOutlinedErrorButton(
-                label = stringResource(id = R.string.cancel),
-                onClick = remember(viewModel) {
-                    { viewModel.trySendAction(DeleteAccountAction.CancelClick) }
-                },
-                modifier = Modifier
-                    .testTag("CANCEL")
-                    .fillMaxWidth()
-                    .padding(horizontal = 16.dp),
-            )
-            Spacer(modifier = Modifier.navigationBarsPadding())
+            Spacer(modifier = Modifier.height(16.dp))
+            if (state.isUserManagedByOrganization) {
+                WarningMessageCard(
+                    headerText =
+                        stringResource(id = R.string.cannot_delete_your_account),
+                    subtitleText =
+                        stringResource(id = R.string.cannot_delete_your_account_explanation),
+                )
+            } else {
+
path: app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountScreen.kt
user: login: david-livefront
body: Can we drop this space.
created_at: 2025-05-02T17:46:31Z
author_association: COLLABORATOR
diff_hunk: @@ -115,61 +121,51 @@ fun DeleteAccountScreen(
                 .fillMaxSize()
                 .verticalScroll(rememberScrollState()),
         ) {
-            Spacer(modifier = Modifier.height(8.dp))
-            Icon(
-                painter = rememberVectorPainter(id = R.drawable.ic_warning),
-                contentDescription = null,
-                tint = BitwardenTheme.colorScheme.status.error,
-                modifier = Modifier.padding(horizontal = 16.dp),
-            )
-            Spacer(modifier = Modifier.height(8.dp))
-            Text(
-                text = stringResource(id = R.string.deleting_your_account_is_permanent),
-                style = BitwardenTheme.typography.headlineSmall,
-                color = BitwardenTheme.colorScheme.status.error,
-                modifier = Modifier
-                    .fillMaxWidth()
-                    .padding(horizontal = 16.dp),
-            )
-            Spacer(modifier = Modifier.height(24.dp))
-            Text(
-                text = stringResource(id = R.string.delete_account_explanation),
-                style = BitwardenTheme.typography.bodyMedium,
-                color = BitwardenTheme.colorScheme.text.primary,
-                modifier = Modifier
-                    .fillMaxWidth()
-                    .padding(horizontal = 16.dp),
-            )
-            Spacer(modifier = Modifier.height(24.dp))
-            DeleteAccountButton(
-                onDeleteAccountConfirmDialogClick = remember(viewModel) {
-                    {
-                        viewModel.trySendAction(
-                            DeleteAccountAction.DeleteAccountConfirmDialogClick(it),
-                        )
-                    }
-                },
-                onDeleteAccountClick = remember(viewModel) {
-                    { viewModel.trySendAction(DeleteAccountAction.DeleteAccountClick) }
-                },
-                isUnlockWithPasswordEnabled = state.isUnlockWithPasswordEnabled,
-                modifier = Modifier
-                    .testTag("DELETE ACCOUNT")
-                    .fillMaxWidth()
-                    .padding(horizontal = 16.dp),
-            )
-            Spacer(modifier = Modifier.height(12.dp))
-            BitwardenOutlinedErrorButton(
-                label = stringResource(id = R.string.cancel),
-                onClick = remember(viewModel) {
-                    { viewModel.trySendAction(DeleteAccountAction.CancelClick) }
-                },
-                modifier = Modifier
-                    .testTag("CANCEL")
-                    .fillMaxWidth()
-                    .padding(horizontal = 16.dp),
-            )
-            Spacer(modifier = Modifier.navigationBarsPadding())
+            Spacer(modifier = Modifier.height(16.dp))
+            if (state.isUserManagedByOrganization) {
+                WarningMessageCard(
+                    headerText =
+                        stringResource(id = R.string.cannot_delete_your_account),
+                    subtitleText =
+                        stringResource(id = R.string.cannot_delete_your_account_explanation),
path: app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountScreen.kt
user: login: david-livefront
body: Can we format this and add the margins here at the top-level.
```kotlin
            if (state.isUserManagedByOrganization) {
                WarningMessageCard(
                    headerText = stringResource(id = R.string.cannot_delete_your_account),
                    subtitleText = stringResource(
                        id = R.string.cannot_delete_your_account_explanation,
                    ),
                    modifier = Modifier.standardHorizontalMargin(),
                )
            } else {
                WarningMessageCard(
                    headerText = stringResource(id = R.string.deleting_your_account_is_permanent),
                    subtitleText = stringResource(id = R.string.delete_account_explanation),
                    modifier = Modifier.standardHorizontalMargin(),
                )
                ...
```
created_at: 2025-05-02T17:47:32Z
author_association: COLLABORATOR
diff_hunk: @@ -32,12 +32,15 @@ class DeleteAccountViewModel @Inject constructor(
     private val authRepository: AuthRepository,
     savedStateHandle: SavedStateHandle,
 ) : BaseViewModel<DeleteAccountState, DeleteAccountEvent, DeleteAccountAction>(
-    initialState = savedStateHandle[KEY_STATE] ?: DeleteAccountState(
-        dialog = null,
-        isUnlockWithPasswordEnabled = requireNotNull(authRepository.userStateFlow.value)
-            .activeAccount
-            .hasMasterPassword,
-    ),
+    initialState = savedStateHandle[KEY_STATE] ?: run {
+        val account = requireNotNull(authRepository.userStateFlow.value).activeAccount
+        DeleteAccountState(
+            dialog = null,
+            isUnlockWithPasswordEnabled = account.hasMasterPassword,
+            isUserManagedByOrganization =
+                account.organizations.any { it.userIsClaimedByOrganization } == true,
path: app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountViewModel.kt
user: login: david-livefront
body: Can we format this a bit:

```kotlin
            isUserManagedByOrganization = account
                .organizations
                .any { it.userIsClaimedByOrganization } == true,
```
created_at: 2025-05-02T17:48:29Z
author_association: COLLABORATOR
diff_hunk: @@ -204,3 +200,59 @@ private fun DeleteAccountButton(
         modifier = modifier,
     )
 }
+
+@Composable
+private fun WarningMessageCard(
+    headerText: String,
+    subtitleText: String,
+) {
+    Row(
+        modifier = Modifier
+            .standardHorizontalMargin()
+            .background(
+                BitwardenTheme.colorScheme.background.secondary,
+                shape = BitwardenTheme.shapes.actionCard,
+            ),
+        verticalAlignment = Alignment.CenterVertically,
+    ) {
+        Spacer(Modifier.width(12.dp))
+        Icon(
+            painter = rememberVectorPainter(id = R.drawable.ic_warning),
path: app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/accountsecurity/deleteaccount/DeleteAccountScreen.kt
user: login: david-livefront
body: It looks like this icon changed somewhere along the line, can you pull in the 24x24 one from Figma
created_at: 2025-05-02T17:56:02Z
author_association: COLLABORATOR
diff_hunk: @@ -1,20 +1,16 @@
 <vector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:width="28dp"
-    android:height="28dp"
-    android:viewportHeight="28"
-    android:viewportWidth="28">
-    <group>
-        <clip-path android:pathData="M0.667,0.667h26.667v26.667h-26.667z" />
-        <path
-            android:fillColor="#BA1A1A"
-            android:fillType="evenOdd"
-            android:pathData="M16.036,3.434L26.957,20.361C28.069,22.083 26.646,24 24.921,24H3.079C1.354,24 -0.069,22.083 1.043,20.361L11.964,3.434C12.91,1.967 15.09,1.967 16.036,3.434ZM14.635,4.337C14.345,3.888 13.655,3.888 13.365,4.337L2.443,21.264C2.141,21.733 2.498,22.333 3.079,22.333H24.921C25.502,22.333 25.859,21.733 25.557,21.264L14.635,4.337Z" />
-        <path
-            android:fillColor="#BA1A1A"
-            android:fillType="evenOdd"
-            android:pathData="M14.001,9.499C14.461,9.499 14.834,9.872 14.834,10.332V15.528C14.834,15.989 14.461,16.362 14.001,16.362C13.541,16.362 13.168,15.989 13.168,15.528V10.332C13.168,9.872 13.541,9.499 14.001,9.499Z" />
-        <path
-            android:fillColor="#BA1A1A"
-            android:pathData="M15.126,19.785C15.126,20.406 14.622,20.91 14.001,20.91C13.38,20.91 12.876,20.406 12.876,19.785C12.876,19.163 13.38,18.66 14.001,18.66C14.622,18.66 15.126,19.163 15.126,19.785Z" />
-    </group>
+    android:width="24dp"
path: app/src/main/res/drawable/ic_warning.xml
user: login: david-livefront
body: 👍 
created_at: 2025-05-02T20:13:08Z
author_association: COLLABORATOR

PR comments:
user: login: github-actions[bot]
created_at: 2025-04-30T16:24:38Z
body: ![Logo](https://cdn.ast.checkmarx.net/integrations/logo/Checkmarx.png)
**Checkmarx One – Scan Summary & Details** – [cc7140ac\-41f0\-4f1c\-80c1\-e896ee847917](https://ast.checkmarx.net/projects/7b48c130-9c07-4ac2-a6dd-15ed4933d967/scans?id=cc7140ac-41f0-4f1c-80c1-e896ee847917&branch=pm-14222%2Fmanaged-user-account-deletion-prevention)
### Great job, no security vulnerabilities found in this Pull Request

author_association: CONTRIBUTOR
user: login: codecov[bot]
created_at: 2025-05-01T10:03:21Z
body: ## [Codecov](https://app.codecov.io/gh/bitwarden/android/pull/5114?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bitwarden) Report
Attention: Patch coverage is `97.29730%` with `2 lines` in your changes missing coverage. Please review.
> Project coverage is 83.95%. Comparing base [(`69708c1`)](https://app.codecov.io/gh/bitwarden/android/commit/69708c1285d6d2007a68feec9cfe3b626ff08f78?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bitwarden) to head [(`96ac143`)](https://app.codecov.io/gh/bitwarden/android/commit/96ac14397b08bee2f6acdcc155c0dde3ac532319?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bitwarden).
> Report is 3 commits behind head on main.

| [Files with missing lines](https://app.codecov.io/gh/bitwarden/android/pull/5114?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bitwarden) | Patch % | Lines |
|---|---|---|
| [...ntsecurity/deleteaccount/DeleteAccountViewModel.kt](https://app.codecov.io/gh/bitwarden/android/pull/5114?src=pr&el=tree&filepath=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fx8bit%2Fbitwarden%2Fui%2Fplatform%2Ffeature%2Fsettings%2Faccountsecurity%2Fdeleteaccount%2FDeleteAccountViewModel.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bitwarden#diff-YXBwL3NyYy9tYWluL2phdmEvY29tL3g4Yml0L2JpdHdhcmRlbi91aS9wbGF0Zm9ybS9mZWF0dXJlL3NldHRpbmdzL2FjY291bnRzZWN1cml0eS9kZWxldGVhY2NvdW50L0RlbGV0ZUFjY291bnRWaWV3TW9kZWwua3Q=) | 80.00% | [0 Missing and 2 partials :warning: ](https://app.codecov.io/gh/bitwarden/android/pull/5114?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bitwarden) |

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##             main    #5114      +/-   ##
==========================================
+ Coverage   82.86%   83.95%   +1.09%     
==========================================
  Files         966      630     -336     
  Lines       57242    49054    -8188     
  Branches     7156     6708     -448     
==========================================
- Hits        47432    41185    -6247     
+ Misses       7351     5631    -1720     
+ Partials     2459     2238     -221     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/bitwarden/android/pull/5114?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bitwarden).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bitwarden).

<details><summary> :rocket: New features to boost your workflow: </summary>

- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
author_association: NONE
user: login: david-livefront
created_at: 2025-05-01T16:02:36Z
body: @aj-rosado Can you link the Figma for this UI?
author_association: COLLABORATOR
user: login: aj-rosado
created_at: 2025-05-01T16:24:04Z
body: > @aj-rosado Can you link the Figma for this UI?

Added Figma to the task on jira
author_association: CONTRIBUTOR
user: login: david-livefront
created_at: 2025-05-01T17:23:29Z
body: @aj-rosado I don't seem to have access to that file. Could you please tag Emily in the existing file about this so it can be we can to make sure that these designs get pulled into the master Figma file and adhere to the Android design system.
author_association: COLLABORATOR
user: login: Nailik
created_at: 2025-05-12T14:11:58Z
body: do i need to update the server for this?
i now get 

```
kotlinx.serialization.MissingFieldException: Field 'userIsClaimedByOrganization' is required for type with serial name 'com.bitwarden.network.model.SyncResponseJson.Profile.Organization', but it was missing at path: $.profile.organizations[0]
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:95)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableElement(StreamingJsonDecoder.kt:168)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.encoding.CompositeDecoder.decodeSerializableElement$default(Decoding.kt:539)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.internal.CollectionLikeSerializer.readElement(CollectionSerializers.kt:80)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.internal.AbstractCollectionSerializer.readElement$default(CollectionSerializers.kt:51)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.internal.AbstractCollectionSerializer.merge(CollectionSerializers.kt:36)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.internal.AbstractCollectionSerializer.deserialize(CollectionSerializers.kt:43)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.encoding.AbstractDecoder.decodeNullableSerializableElement(AbstractDecoder.kt:78)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at com.bitwarden.network.model.SyncResponseJson$Profile$$serializer.deserialize(SyncResponseJson.kt:158)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at com.bitwarden.network.model.SyncResponseJson$Profile$$serializer.deserialize(SyncResponseJson.kt:158)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableElement(StreamingJsonDecoder.kt:168)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at com.bitwarden.network.model.SyncResponseJson$$serializer.deserialize(SyncResponseJson.kt:26)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at com.bitwarden.network.model.SyncResponseJson$$serializer.deserialize(SyncResponseJson.kt:26)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.json.Json.decodeFromString(Json.kt:149)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at retrofit2.converter.kotlinx.serialization.Serializer$FromString.fromResponseBody(Serializer.kt:26)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at retrofit2.converter.kotlinx.serialization.DeserializationStrategyConverter.convert(DeserializationStrategyConverter.kt:11)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at retrofit2.converter.kotlinx.serialization.DeserializationStrategyConverter.convert(DeserializationStrategyConverter.kt:7)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:246)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:156)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1156)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:651)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at java.lang.Thread.run(Thread.java:1119)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  Caused by: kotlinx.serialization.MissingFieldException: Field 'userIsClaimedByOrganization' is required for type with serial name 'com.bitwarden.network.model.SyncResponseJson.Profile.Organization', but it was missing
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.internal.PluginExceptionsKt.throwMissingFieldException(PluginExceptions.kt:20)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at com.bitwarden.network.model.SyncResponseJson$Profile$Organization.<init>(SyncResponseJson.kt:254)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at com.bitwarden.network.model.SyncResponseJson$Profile$Organization$$serializer.deserialize(SyncResponseJson.kt:254)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at com.bitwarden.network.model.SyncResponseJson$Profile$Organization$$serializer.deserialize(SyncResponseJson.kt:254)
2025-05-12 16:14:22.669 14072-14171 NetworkResultCall       com.x8bit.bitwarden.dev              W  	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:69)
```

 when trying to sync server data on dev app.
 note: i have created an orgianization where i am the owner
author_association: CONTRIBUTOR
user: login: david-livefront
created_at: 2025-05-12T17:52:58Z
body: @Nailik I believe you do need to update to a newer server version in order to receive that value but I have merged a separate PR to eliminate that requirement.

That update can be found [here](https://github.com/bitwarden/android/pull/5174).
author_association: COLLABORATOR