1
0
mirror of https://github.com/bitwarden/server synced 2025-12-15 07:43:54 +00:00

[AC-2662] Remove FC MVP from CurrentContext (#4460)

* chore: remove EditAssignedCollections from current context, refs AC-2662

* chore: remove DeleteAssignedCollections from CurrentContext, refs AC-2662

* chore: remove ViewAssignedCollections from CurrentContext, refs AC-2662
This commit is contained in:
Vincent Salucci
2024-07-08 14:40:35 -05:00
committed by GitHub
parent b61b1eadaf
commit 3f443ac49b
6 changed files with 0 additions and 69 deletions

View File

@@ -336,32 +336,6 @@ public class CurrentContext : ICurrentContext
return await EditAnyCollection(orgId) || (org != null && org.Permissions.DeleteAnyCollection);
}
public async Task<bool> EditAssignedCollections(Guid orgId)
{
return await OrganizationManager(orgId) || (Organizations?.Any(o => o.Id == orgId
&& (o.Permissions?.EditAssignedCollections ?? false)) ?? false);
}
public async Task<bool> DeleteAssignedCollections(Guid orgId)
{
return await OrganizationManager(orgId) || (Organizations?.Any(o => o.Id == orgId
&& (o.Permissions?.DeleteAssignedCollections ?? false)) ?? false);
}
public async Task<bool> ViewAssignedCollections(Guid orgId)
{
/*
* Required to display the existing collections under which the new collection can be nested.
* Owner, Admin, Manager, and Provider checks are handled via the EditAssigned/DeleteAssigned context calls.
* This entire method will be moved to the CollectionAuthorizationHandler in the future
*/
var org = GetOrganization(orgId);
return await EditAssignedCollections(orgId)
|| await DeleteAssignedCollections(orgId)
|| (org != null && org.Permissions.CreateNewCollections);
}
public async Task<bool> ManageGroups(Guid orgId)
{
return await OrganizationAdmin(orgId) || (Organizations?.Any(o => o.Id == orgId