1
0
mirror of https://github.com/bitwarden/server synced 2025-12-14 23:33:41 +00:00

[PM-2943] Enable Nullable Repositories in Unowned Files (#4549)

* Enable Nullable In Unowned Repos

* Update More Tests

* Move to One If

* Fix Collections

* Format

* Add Migrations

* Move Pragma Annotation

* Add Better Assert Message
This commit is contained in:
Justin Baur
2024-07-24 09:48:09 -04:00
committed by GitHub
parent b5f09c599b
commit 1e0182008b
67 changed files with 8432 additions and 119 deletions

View File

@@ -1,6 +1,8 @@
using Bit.Core.Entities;
using Bit.Core.Models.Data;
#nullable enable
namespace Bit.Core.Repositories;
public interface ICollectionRepository : IRepository<Collection, Guid>
@@ -10,7 +12,7 @@ public interface ICollectionRepository : IRepository<Collection, Guid>
/// <summary>
/// Returns a collection and fetches group/user associations for the collection.
/// </summary>
Task<Tuple<Collection, CollectionAccessDetails>> GetByIdWithAccessAsync(Guid id);
Task<Tuple<Collection?, CollectionAccessDetails>> GetByIdWithAccessAsync(Guid id);
/// <summary>
/// Return all collections that belong to the organization. Does not include any permission details or group/user
@@ -43,7 +45,7 @@ public interface ICollectionRepository : IRepository<Collection, Guid>
/// This does not perform any authorization checks internally!
/// Optionally, you can include access relationships for other Groups/Users and the collection.
/// </summary>
Task<CollectionAdminDetails> GetByIdWithPermissionsAsync(Guid collectionId, Guid? userId, bool includeAccessRelationships);
Task<CollectionAdminDetails?> GetByIdWithPermissionsAsync(Guid collectionId, Guid? userId, bool includeAccessRelationships);
Task CreateAsync(Collection obj, IEnumerable<CollectionAccessSelection> groups, IEnumerable<CollectionAccessSelection> users);
Task ReplaceAsync(Collection obj, IEnumerable<CollectionAccessSelection> groups, IEnumerable<CollectionAccessSelection> users);