mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 00:52:49 -05:00
Fix logic, add comment
This commit is contained in:
@ -159,7 +159,7 @@ public class CollectionsController : Controller
|
|||||||
|
|
||||||
var authorized = FlexibleCollectionsIsEnabled()
|
var authorized = FlexibleCollectionsIsEnabled()
|
||||||
? (await _authorizationService.AuthorizeAsync(User, collection, CollectionOperations.Create)).Succeeded
|
? (await _authorizationService.AuthorizeAsync(User, collection, CollectionOperations.Create)).Succeeded
|
||||||
: await CanCreateCollection(orgId, collection.Id) && await CanEditCollectionAsync(orgId, collection.Id);
|
: await CanCreateCollection(orgId, collection.Id) || await CanEditCollectionAsync(orgId, collection.Id);
|
||||||
if (!authorized)
|
if (!authorized)
|
||||||
{
|
{
|
||||||
throw new NotFoundException();
|
throw new NotFoundException();
|
||||||
@ -202,6 +202,8 @@ public class CollectionsController : Controller
|
|||||||
|
|
||||||
[HttpPost("bulk-access")]
|
[HttpPost("bulk-access")]
|
||||||
[RequireFeature(FeatureFlagKeys.BulkCollectionAccess)]
|
[RequireFeature(FeatureFlagKeys.BulkCollectionAccess)]
|
||||||
|
// Also gated behind Flexible Collections flag because it only has new authorization logic.
|
||||||
|
// Could be removed if legacy authorization logic were implemented for many collections.
|
||||||
[RequireFeature(FeatureFlagKeys.FlexibleCollections)]
|
[RequireFeature(FeatureFlagKeys.FlexibleCollections)]
|
||||||
public async Task PostBulkCollectionAccess([FromBody] BulkCollectionAccessRequestModel model)
|
public async Task PostBulkCollectionAccess([FromBody] BulkCollectionAccessRequestModel model)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user