mirror of
https://github.com/bitwarden/server.git
synced 2025-07-18 16:11:28 -05:00
[SM-380] Access checks for listing projects (#2496)
* Add project access checks for listing
This commit is contained in:
@ -34,6 +34,7 @@ public class CurrentContext : ICurrentContext
|
||||
public virtual int? BotScore { get; set; }
|
||||
public virtual string ClientId { get; set; }
|
||||
public virtual Version ClientVersion { get; set; }
|
||||
public virtual ClientType ClientType { get; set; }
|
||||
|
||||
public CurrentContext(IProviderUserRepository providerUserRepository)
|
||||
{
|
||||
@ -138,6 +139,13 @@ public class CurrentContext : ICurrentContext
|
||||
}
|
||||
}
|
||||
|
||||
var clientType = GetClaimValue(claimsDict, Claims.Type);
|
||||
if (clientType != null)
|
||||
{
|
||||
Enum.TryParse(clientType, out ClientType c);
|
||||
ClientType = c;
|
||||
}
|
||||
|
||||
DeviceIdentifier = GetClaimValue(claimsDict, Claims.Device);
|
||||
|
||||
Organizations = GetOrganizations(claimsDict, orgApi);
|
||||
|
@ -1,6 +1,7 @@
|
||||
using System.Security.Claims;
|
||||
using Bit.Core.Entities;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Identity;
|
||||
using Bit.Core.Repositories;
|
||||
using Bit.Core.Settings;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
@ -18,6 +19,7 @@ public interface ICurrentContext
|
||||
List<CurrentContentOrganization> Organizations { get; set; }
|
||||
Guid? InstallationId { get; set; }
|
||||
Guid? OrganizationId { get; set; }
|
||||
ClientType ClientType { get; set; }
|
||||
bool IsBot { get; set; }
|
||||
bool MaybeBot { get; set; }
|
||||
int? BotScore { get; set; }
|
||||
|
Reference in New Issue
Block a user