mirror of
https://github.com/bitwarden/server
synced 2025-12-14 15:23:42 +00:00
[AC-1331] Remove Manager role - final (#4493)
* Remove OrganizationUserType.Manager * Add EnumDataType validation to prevent invalid enum values
This commit is contained in:
@@ -217,17 +217,6 @@ public class CurrentContext : ICurrentContext
|
||||
}));
|
||||
}
|
||||
|
||||
if (claimsDict.ContainsKey(Claims.OrganizationManager))
|
||||
{
|
||||
organizations.AddRange(claimsDict[Claims.OrganizationManager].Select(c =>
|
||||
new CurrentContextOrganization
|
||||
{
|
||||
Id = new Guid(c.Value),
|
||||
Type = OrganizationUserType.Manager,
|
||||
AccessSecretsManager = accessSecretsManager.ContainsKey(c.Value),
|
||||
}));
|
||||
}
|
||||
|
||||
if (claimsDict.ContainsKey(Claims.OrganizationCustom))
|
||||
{
|
||||
organizations.AddRange(claimsDict[Claims.OrganizationCustom].Select(c =>
|
||||
@@ -274,12 +263,6 @@ public class CurrentContext : ICurrentContext
|
||||
return (Organizations?.Any(o => o.Id == orgId) ?? false) || await OrganizationOwner(orgId);
|
||||
}
|
||||
|
||||
public async Task<bool> OrganizationManager(Guid orgId)
|
||||
{
|
||||
return await OrganizationAdmin(orgId) ||
|
||||
(Organizations?.Any(o => o.Id == orgId && o.Type == OrganizationUserType.Manager) ?? false);
|
||||
}
|
||||
|
||||
public async Task<bool> OrganizationAdmin(Guid orgId)
|
||||
{
|
||||
return await OrganizationOwner(orgId) ||
|
||||
|
||||
Reference in New Issue
Block a user