mirror of
https://github.com/bitwarden/server
synced 2025-12-17 08:43:27 +00:00
api adjustments for manager role and collections
This commit is contained in:
@@ -111,6 +111,16 @@ namespace Bit.Core
|
||||
Type = OrganizationUserType.User
|
||||
}));
|
||||
}
|
||||
|
||||
if(claimsDict.ContainsKey("orgmanager"))
|
||||
{
|
||||
Organizations.AddRange(claimsDict["orgmanager"].Select(c =>
|
||||
new CurrentContentOrganization
|
||||
{
|
||||
Id = new Guid(c.Value),
|
||||
Type = OrganizationUserType.Manager
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
public bool OrganizationUser(Guid orgId)
|
||||
@@ -118,6 +128,13 @@ namespace Bit.Core
|
||||
return Organizations?.Any(o => o.Id == orgId) ?? false;
|
||||
}
|
||||
|
||||
public bool OrganizationManager(Guid orgId)
|
||||
{
|
||||
return Organizations?.Any(o => o.Id == orgId &&
|
||||
(o.Type == OrganizationUserType.Owner || o.Type == OrganizationUserType.Admin ||
|
||||
o.Type == OrganizationUserType.Manager)) ?? false;
|
||||
}
|
||||
|
||||
public bool OrganizationAdmin(Guid orgId)
|
||||
{
|
||||
return Organizations?.Any(o => o.Id == orgId &&
|
||||
|
||||
Reference in New Issue
Block a user