bitwarden/server · error · BadRequestException

You cannot add yourself to a collection.

Error message

You cannot add yourself to a collection.

What it means

Error "You cannot add yourself to a collection." thrown in bitwarden/server.

Source

Thrown at src/Api/AdminConsole/Controllers/OrganizationUsersController.cs:482

            collectionAccessToSave, groupsToSave, model.DefaultUserCollectionName);

        return TypedResults.Ok();
    }

    /// <summary>
    /// Resolves the collection access to persist for an organization user update, enforcing the saving user's
    /// authorization over the affected collections.
    /// </summary>
    private async Task<List<CollectionAccessSelection>> GetAuthorizedCollectionsToSaveAsync(OrganizationUserUpdateRequestModel model, ICollection<CollectionAccessSelection> currentAccess, bool editingSelf, Organization organization)
    {
        // A self-editing user can't add themselves to collections they don't already have access to,
        // unless admins can access all collections.
        var currentAccessIds = currentAccess.Select(c => c.Id).ToHashSet();
        if (editingSelf &&
            !organization.AllowAdminAccessToAllCollectionItems &&
            model.Collections.Any(c => !currentAccessIds.Contains(c.Id)))
        {
            throw new BadRequestException("You cannot add yourself to a collection.");
        }

        // Authorization check:
        // You must have authorization to ModifyUserAccess for all collections being saved.
        var postedCollections = await _collectionRepository.GetManyByManyIdsAsync(model.Collections.Select(c => c.Id));
        if (postedCollections.Count != 0 &&
            !(await _authorizationService.AuthorizeAsync(User, postedCollections, BulkCollectionOperations.ModifyUserAccess)).Succeeded)
        {
            throw new NotFoundException();
        }

        // Preserve the target's current collections the saving user can't edit, so they aren't overwritten.
        var currentCollections = await _collectionRepository.GetManyByManyIdsAsync(currentAccess.Select(cas => cas.Id));

        var readonlyCollectionIds = new HashSet<Guid>();

        foreach (var collection in currentCollections)
        {

View on GitHub (pinned to e93b962371)

Solutions

  1. Have another owner or admin add you to the collection instead of adding yourself.
  2. Assign the collection to a group you belong to and manage membership through the group.

When it happens

Trigger: Thrown when an organization user attempts to add themselves to a collection via the user-collection assignment endpoint, which is disallowed; another admin must perform the assignment.

Common situations: See trigger scenarios.


AI-assisted analysis of bitwarden/server@e93b962371 (2026-08-13). Data as JSON: /api/errors/9f2b9deb3e615c5e. Report an issue: GitHub.