Changed the check of the add note API
This commit is contained in:
parent
d41c49af7b
commit
b069e9f07d
@ -2033,7 +2033,7 @@ namespace Marco.Pms.Services.Service
|
|||||||
{
|
{
|
||||||
var bucketIds = await _context.ContactBucketMappings.Where(cb => cb.ContactId == noteDto.ContactId).Select(cb => cb.BucketId).ToListAsync();
|
var bucketIds = await _context.ContactBucketMappings.Where(cb => cb.ContactId == noteDto.ContactId).Select(cb => cb.BucketId).ToListAsync();
|
||||||
var hasContactAccess = await _context.EmployeeBucketMappings.AnyAsync(eb => bucketIds.Contains(eb.BucketId) && eb.EmployeeId == loggedInEmployee.Id);
|
var hasContactAccess = await _context.EmployeeBucketMappings.AnyAsync(eb => bucketIds.Contains(eb.BucketId) && eb.EmployeeId == loggedInEmployee.Id);
|
||||||
if (hasContactAccess)
|
if (!hasContactAccess)
|
||||||
{
|
{
|
||||||
_logger.LogWarning("Employee {EmployeeId} does not have permission to delete contact {ContactId}",
|
_logger.LogWarning("Employee {EmployeeId} does not have permission to delete contact {ContactId}",
|
||||||
loggedInEmployee.Id, noteDto.ContactId);
|
loggedInEmployee.Id, noteDto.ContactId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user