1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-04 09:32:48 -05:00

Enable unassigned items banner for self-host (#3978)

This commit is contained in:
Thomas Rittson
2024-04-12 21:40:43 +10:00
committed by GitHub
parent 736a6f19a5
commit 66f0c4b982
2 changed files with 5 additions and 5 deletions

View File

@ -1118,11 +1118,10 @@ public class CiphersController : Controller
[HttpGet("has-unassigned-ciphers")]
public async Task<bool> HasUnassignedCiphers()
{
var orgAbilities = await _applicationCacheService.GetOrganizationAbilitiesAsync();
// We don't filter for organization.FlexibleCollections here, it's shown for all orgs, and the client determines
// whether the message is shown in future tense (not yet migrated) or present tense (already migrated)
var adminOrganizations = _currentContext.Organizations
.Where(o => o.Type is OrganizationUserType.Admin or OrganizationUserType.Owner &&
orgAbilities.ContainsKey(o.Id) && orgAbilities[o.Id].FlexibleCollections);
.Where(o => o.Type is OrganizationUserType.Admin or OrganizationUserType.Owner);
foreach (var org in adminOrganizations)
{