Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/Core/Authorization/AuthorizationResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,17 @@ public bool AreColumnsAllowedForOperation(string entityName, string roleName, En

if (!EntityPermissionsMap[entityName].RoleToOperationMap.TryGetValue(roleName, out RoleMetadata? roleMetadata) && roleMetadata is null)
{
return false;
if (ROLE_ANONYMOUS.Equals(roleName, StringComparison.OrdinalIgnoreCase) ||
ROLE_AUTHENTICATED.Equals(roleName, StringComparison.OrdinalIgnoreCase))
{
return false;
}

// roleName is a custom role and derives from authenticated role. Let's try with authenticated role.
if (!EntityPermissionsMap[entityName].RoleToOperationMap.TryGetValue(ROLE_AUTHENTICATED, out roleMetadata) && roleMetadata is null)
{
return false;
}
}

// Short circuit when OperationMetadata lookup fails. When lookup succeeds, operationToColumnMap will be populated
Expand Down