mirror of
https://github.com/bitwarden/server.git
synced 2025-02-02 23:41:21 +01:00
check user access permissions on collections edit
This commit is contained in:
parent
68c349f72f
commit
0816c609db
@ -10,7 +10,6 @@ using Bit.Core.Services;
|
|||||||
using Bit.Core;
|
using Bit.Core;
|
||||||
using Bit.Api.Utilities;
|
using Bit.Api.Utilities;
|
||||||
using Bit.Core.Utilities;
|
using Bit.Core.Utilities;
|
||||||
using Core.Models.Data;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Bit.Core.Models.Table;
|
using Bit.Core.Models.Table;
|
||||||
|
|
||||||
|
@ -478,6 +478,10 @@ namespace Bit.Core.Services
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if(!(await UserCanEditAsync(cipher, savingUserId)))
|
||||||
|
{
|
||||||
|
throw new BadRequestException("You do not have permissions to edit this.");
|
||||||
|
}
|
||||||
await _collectionCipherRepository.UpdateCollectionsAsync(cipher.Id, savingUserId, collectionIds);
|
await _collectionCipherRepository.UpdateCollectionsAsync(cipher.Id, savingUserId, collectionIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user