Start work on integration tests

This commit is contained in:
Nikolaj Geisle
2022-06-21 08:45:33 +02:00
parent 8ab5aa1a41
commit c283cc498f
3 changed files with 33 additions and 3 deletions

View File

@@ -9,10 +9,10 @@ public static class ReadOnlyUserGroupExtensions
/// Checks if a readonly user group has access to a given language
/// </summary>
/// <remarks> If allowed languages on the user group is empty, it means that we have access to all languages, and thus have access to the language</remarks>
public static bool HasAccessToLanguage(this IReadOnlyUserGroup readOnlyUserGroup, Language? language)
public static bool HasAccessToLanguage(this IReadOnlyUserGroup readOnlyUserGroup, int languageId)
{
if (readOnlyUserGroup.AllowedLanguages.Any() is false || (language is not null && readOnlyUserGroup.AllowedLanguages.Contains(language.Id)))
if (readOnlyUserGroup.AllowedLanguages.Any() is false || readOnlyUserGroup.AllowedLanguages.Contains(languageId))
{
return true;
}

View File

@@ -235,7 +235,7 @@ public class ContentVariantMapper
}
}
if (group.HasAccessToLanguage(variantDisplay.Language))
if (variantDisplay.Language is not null && group.HasAccessToLanguage(variantDisplay.Language.Id))
{
hasAccess = true;
break;