From a386241edfe5a7497b48a070c989129c1e35eb92 Mon Sep 17 00:00:00 2001 From: Wil Stead Date: Wed, 24 Aug 2022 15:39:09 -0400 Subject: [PATCH] Group permissions --- .github/workflows/publish.yml | 2 +- Test/SerializationTests.cs | 30 ++++++- docs/CHANGELOG.md | 4 + src/Models/Article.cs | 143 ++++++++++++++++++++++++++++++---- src/Models/Category.cs | 122 +++++++++++++++++++++++++---- src/Models/WikiFile.cs | 124 +++++++++++++++++++++++++---- 6 files changed, 376 insertions(+), 49 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5112df1..395059a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,6 +1,6 @@ name: publish env: - VERSION: '0.8.3-preview' + VERSION: '0.8.4-preview' PRERELEASE: true on: push: diff --git a/Test/SerializationTests.cs b/Test/SerializationTests.cs index a378cf7..46c6a7d 100644 --- a/Test/SerializationTests.cs +++ b/Test/SerializationTests.cs @@ -8,7 +8,7 @@ namespace Tavenem.Wiki.Test; [TestClass] public class SerializationTests { - private static readonly WikiOptions _Options = new WikiOptions(); + private static readonly WikiOptions _Options = new(); [TestMethod] public void ArticleTest() @@ -28,6 +28,8 @@ public void ArticleTest() null, null, null, + null, + null, false, false, new ReadOnlyCollection(Array.Empty()), @@ -55,6 +57,8 @@ public void ArticleTest() new ReadOnlyCollection(new string[] { "TEST_VIEWER_ID" }), null, null, + null, + null, false, false, new ReadOnlyCollection(Array.Empty()), @@ -86,6 +90,8 @@ public void ArticleTest_Context() null, null, null, + null, + null, false, false, new ReadOnlyCollection(Array.Empty()), @@ -114,6 +120,8 @@ public void ArticleTest_Context() new ReadOnlyCollection(new string[] { "TEST_VIEWER_ID" }), null, null, + null, + null, false, false, new ReadOnlyCollection(Array.Empty()), @@ -145,6 +153,8 @@ public void CategoryTest() "TEST_OWNER_ID", null, null, + null, + null, new ReadOnlyCollection(Array.Empty()), null); @@ -173,6 +183,8 @@ public void CategoryTest_Context() "TEST_OWNER_ID", null, null, + null, + null, new ReadOnlyCollection(Array.Empty()), null); @@ -353,6 +365,8 @@ public void MixedArticleTypesTest() null, null, null, + null, + null, false, false, new ReadOnlyCollection(Array.Empty()), @@ -371,6 +385,8 @@ public void MixedArticleTypesTest() "TEST_OWNER_ID", null, null, + null, + null, new ReadOnlyCollection(Array.Empty()), null), new WikiFile( @@ -390,6 +406,8 @@ public void MixedArticleTypesTest() "TEST_OWNER_ID", null, null, + null, + null, new ReadOnlyCollection(Array.Empty()), null), }; @@ -423,6 +441,8 @@ public void MixedArticleTypesTest_Context() null, null, null, + null, + null, false, false, new ReadOnlyCollection(Array.Empty()), @@ -441,6 +461,8 @@ public void MixedArticleTypesTest_Context() "TEST_OWNER_ID", null, null, + null, + null, new ReadOnlyCollection(Array.Empty()), null), new WikiFile( @@ -460,6 +482,8 @@ public void MixedArticleTypesTest_Context() "TEST_OWNER_ID", null, null, + null, + null, new ReadOnlyCollection(Array.Empty()), null), }; @@ -520,6 +544,8 @@ public void WikiFileTest() "TEST_OWNER_ID", null, null, + null, + null, new ReadOnlyCollection(Array.Empty()), null); @@ -551,6 +577,8 @@ public void WikiFileTest_Context() "TEST_OWNER_ID", null, null, + null, + null, new ReadOnlyCollection(Array.Empty()), null); diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index f88499b..48077c0 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.8.4-preview +### Changed +- Modified constructors to add support for group permissions. + ## 0.8.3-preview ### Changed - Group page edit permission based solely on group membership. diff --git a/src/Models/Article.cs b/src/Models/Article.cs index 54bdd5e..7661b88 100644 --- a/src/Models/Article.cs +++ b/src/Models/Article.cs @@ -293,7 +293,7 @@ public DateTimeOffset Timestamp /// /// /// - /// The user(s) and/or group(s) allowed to edit this article. + /// The users allowed to edit this article. /// /// /// If the article can be edited by anyone. @@ -303,13 +303,10 @@ public DateTimeOffset Timestamp /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to make edits. /// - /// - /// Cannot be set if the is . - /// /// /// /// - /// The user(s) and/or group(s) allowed to view this article. + /// The users allowed to view this article. /// /// /// If the article can be viewed by anyone. @@ -319,8 +316,31 @@ public DateTimeOffset Timestamp /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to view the article. /// + /// + /// + /// + /// The groups allowed to edit this article. + /// /// - /// Cannot be set if the is . + /// If the article can be edited by anyone. + /// + /// + /// If non- the article can only be edited by those listed, plus its + /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to make edits. + /// + /// + /// + /// + /// The groups allowed to view this article. + /// + /// + /// If the article can be viewed by anyone. + /// + /// + /// If non- the article can only be viewed by those listed, plus its + /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to view the article. /// /// /// @@ -357,6 +377,8 @@ public Article( string? owner, IReadOnlyCollection? allowedEditors, IReadOnlyCollection? allowedViewers, + IReadOnlyCollection? allowedEditorGroups, + IReadOnlyCollection? allowedViewerGroups, string? redirectNamespace, string? redirectTitle, bool isBrokenRedirect, @@ -373,6 +395,8 @@ public Article( { AllowedEditors = allowedEditors; AllowedViewers = allowedViewers; + AllowedEditorGroups = allowedEditorGroups; + AllowedViewerGroups = allowedViewerGroups; } Categories = categories; IsBrokenRedirect = isBrokenRedirect; @@ -400,6 +424,8 @@ private protected Article( string? owner = null, IEnumerable? allowedEditors = null, IEnumerable? allowedViewers = null, + IEnumerable? allowedEditorGroups = null, + IEnumerable? allowedViewerGroups = null, IList? categories = null, IList? transclusions = null, string? redirectNamespace = null, @@ -416,6 +442,8 @@ private protected Article( { AllowedEditors = allowedEditors?.ToList().AsReadOnly(); AllowedViewers = allowedViewers?.ToList().AsReadOnly(); + AllowedEditorGroups = allowedEditorGroups?.ToList().AsReadOnly(); + AllowedViewerGroups = allowedViewerGroups?.ToList().AsReadOnly(); } Categories = new ReadOnlyCollection(categories ?? new List()); IsBrokenRedirect = isBrokenRedirect; @@ -632,7 +660,7 @@ public static (string wikiNamespace, string title, bool isTalk, bool defaultName /// /// /// - /// The user(s) and/or group(s) allowed to edit this article. + /// The users allowed to edit this article. /// /// /// If the article can be edited by anyone. @@ -645,7 +673,33 @@ public static (string wikiNamespace, string title, bool isTalk, bool defaultName /// /// /// - /// The user(s) and/or group(s) allowed to view this article. + /// The users allowed to view this article. + /// + /// + /// If the article can be viewed by anyone. + /// + /// + /// If non- the article can only be viewed by those listed, plus its + /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to view the article. + /// + /// + /// + /// + /// The groups allowed to edit this article. + /// + /// + /// If the article can be edited by anyone. + /// + /// + /// If non- the article can only be edited by those listed, plus its + /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to make edits. + /// + /// + /// + /// + /// The groups allowed to view this article. /// /// /// If the article can be viewed by anyone. @@ -665,7 +719,9 @@ public static async Task
NewAsync( string? wikiNamespace = null, string? owner = null, IEnumerable? allowedEditors = null, - IEnumerable? allowedViewers = null) + IEnumerable? allowedViewers = null, + IEnumerable? allowedEditorGroups = null, + IEnumerable? allowedViewerGroups = null) { if (string.IsNullOrWhiteSpace(title)) { @@ -674,7 +730,18 @@ public static async Task
NewAsync( wikiNamespace = wikiNamespace?.ToWikiTitleCase(); if (string.Equals(wikiNamespace, options.CategoryNamespace, StringComparison.CurrentCultureIgnoreCase)) { - return await Category.NewAsync(options, dataStore, title, editor, markdown, owner, allowedEditors, allowedViewers).ConfigureAwait(false); + return await Category.NewAsync( + options, + dataStore, + title, + editor, + markdown, + owner, + allowedEditors, + allowedViewers, + allowedEditorGroups, + allowedViewerGroups) + .ConfigureAwait(false); } if (options.ReservedNamespaces.Any(x => string.Equals(wikiNamespace, x, StringComparison.CurrentCultureIgnoreCase))) { @@ -737,6 +804,8 @@ await CreatePageReferenceAsync(dataStore, wikiId, title, wikiNamespace) owner, allowedEditors, allowedViewers, + allowedEditorGroups, + allowedViewerGroups, wikiLinks) .ConfigureAwait(false); @@ -766,6 +835,8 @@ await PostprocessArticleMarkdownAsync( owner, allowedEditors, allowedViewers, + allowedEditorGroups, + allowedViewerGroups, categories, transclusions, redirectNamespace, @@ -1172,6 +1243,8 @@ private protected static async Task> UpdateCategoriesAsync( string? owner, IEnumerable? allowedEditors, IEnumerable? allowedViewers, + IEnumerable? allowedEditorGroups, + IEnumerable? allowedViewerGroups, IEnumerable wikiLinks, IEnumerable? previousCategories = null) { @@ -1186,7 +1259,17 @@ private protected static async Task> UpdateCategoriesAsync( foreach (var categoryTitle in currentCategories.Except(oldCategories)) { var category = await Category.GetCategoryAsync(options, dataStore, categoryTitle, false) - ?? await Category.NewAsync(options, dataStore, categoryTitle, editor, null, owner, allowedEditors, allowedViewers).ConfigureAwait(false); + ?? await Category.NewAsync( + options, + dataStore, + categoryTitle, + editor, + null, + owner, + allowedEditors, + allowedViewers, + allowedEditorGroups, + allowedViewerGroups).ConfigureAwait(false); if (!category.ChildIds.Contains(id)) { await category.AddArticleAsync(dataStore, id).ConfigureAwait(false); @@ -1743,7 +1826,7 @@ public async Task GetMarkdownAsync(IDataStore dataStore, DateTimeOffset /// /// /// - /// The user(s) and/or group(s) allowed to edit this article. + /// The users allowed to edit this article. /// /// /// If the article can be edited by anyone. @@ -1756,7 +1839,33 @@ public async Task GetMarkdownAsync(IDataStore dataStore, DateTimeOffset /// /// /// - /// The user(s) and/or group(s) allowed to view this article. + /// The users allowed to view this article. + /// + /// + /// If the article can be viewed by anyone. + /// + /// + /// If non- the article can only be viewed by those listed, plus its + /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to view the article. + /// + /// + /// + /// + /// The groups allowed to edit this article. + /// + /// + /// If the article can be edited by anyone. + /// + /// + /// If non- the article can only be edited by those listed, plus its + /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to make edits. + /// + /// + /// + /// + /// The groups allowed to view this article. /// /// /// If the article can be viewed by anyone. @@ -1778,7 +1887,9 @@ public async Task ReviseAsync( bool isDeleted = false, string? owner = null, IEnumerable? allowedEditors = null, - IEnumerable? allowedViewers = null) + IEnumerable? allowedViewers = null, + IEnumerable? allowedEditorGroups = null, + IEnumerable? allowedViewerGroups = null) { title ??= title?.ToWikiTitleCase() ?? Title; if (string.IsNullOrWhiteSpace(wikiNamespace)) @@ -1903,6 +2014,8 @@ await AddPageLinksAsync(dataStore, Id, WikiLinks.Except(previousWikiLinks)) owner, allowedEditors, allowedViewers, + allowedEditorGroups, + allowedViewerGroups, WikiLinks, Categories) .ConfigureAwait(false)) @@ -1923,6 +2036,8 @@ await AddPageLinksAsync(dataStore, Id, WikiLinks.Except(previousWikiLinks)) Owner = owner; AllowedEditors = allowedEditors?.ToList().AsReadOnly(); AllowedViewers = allowedViewers?.ToList().AsReadOnly(); + AllowedEditorGroups = allowedEditorGroups?.ToList().AsReadOnly(); + AllowedViewerGroups = allowedViewerGroups?.ToList().AsReadOnly(); var revision = new Revision( Id, diff --git a/src/Models/Category.cs b/src/Models/Category.cs index c12d195..1f69071 100644 --- a/src/Models/Category.cs +++ b/src/Models/Category.cs @@ -63,34 +63,54 @@ public sealed class Category : Article /// /// /// - /// The user(s) and/or group(s) allowed to edit this article. + /// The users allowed to edit this category. /// /// - /// If the article can be edited by anyone. + /// If the category can be edited by anyone. /// /// - /// If non- the article can only be edited by those listed, plus its + /// If non- the category can only be edited by those listed, plus its /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to make edits. /// + /// + /// + /// + /// The users allowed to view this category. + /// + /// + /// If the category can be viewed by anyone. + /// /// - /// Cannot be set if the is . + /// If non- the category can only be viewed by those listed, plus its + /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to view the category. /// /// - /// + /// /// - /// The user(s) and/or group(s) allowed to view this article. + /// The groups allowed to edit this category. /// /// - /// If the article can be viewed by anyone. + /// If the category can be edited by anyone. /// /// - /// If non- the article can only be viewed by those listed, plus its + /// If non- the category can only be edited by those listed, plus its /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to view the article. + /// langword="null"/>) list allows only the owner to make edits. + /// + /// + /// + /// + /// The groups allowed to view this category. /// /// - /// Cannot be set if the is . + /// If the category can be viewed by anyone. + /// + /// + /// If non- the category can only be viewed by those listed, plus its + /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to view the category. /// /// /// @@ -117,6 +137,8 @@ public Category( string? owner, IReadOnlyCollection? allowedEditors, IReadOnlyCollection? allowedViewers, + IReadOnlyCollection? allowedEditorGroups, + IReadOnlyCollection? allowedViewerGroups, IReadOnlyCollection categories, IReadOnlyList? transclusions) : base( id, @@ -131,6 +153,8 @@ public Category( owner, allowedEditors, allowedViewers, + allowedEditorGroups, + allowedViewerGroups, null, null, false, @@ -151,6 +175,8 @@ private Category( string? owner = null, IEnumerable? allowedEditors = null, IEnumerable? allowedViewers = null, + IEnumerable? allowedEditorGroups = null, + IEnumerable? allowedViewerGroups = null, IList? categories = null, IList? transclusions = null) : base( id, @@ -165,6 +191,8 @@ private Category( owner, allowedEditors, allowedViewers, + allowedEditorGroups, + allowedViewerGroups, categories, transclusions) { } @@ -235,7 +263,7 @@ private Category( /// /// /// - /// The user(s) and/or group(s) allowed to edit this category. + /// The users allowed to edit this category. /// /// /// If the category can be edited by anyone. @@ -248,7 +276,33 @@ private Category( /// /// /// - /// The user(s) and/or group(s) allowed to view this category. + /// The users allowed to view this category. + /// + /// + /// If the category can be viewed by anyone. + /// + /// + /// If non- the category can only be viewed by those listed, plus its + /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to view the category. + /// + /// + /// + /// + /// The groups allowed to edit this category. + /// + /// + /// If the category can be edited by anyone. + /// + /// + /// If non- the category can only be edited by those listed, plus its + /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to make edits. + /// + /// + /// + /// + /// The groups allowed to view this category. /// /// /// If the category can be viewed by anyone. @@ -267,7 +321,9 @@ public static async Task NewAsync( string? markdown = null, string? owner = null, IEnumerable? allowedEditors = null, - IEnumerable? allowedViewers = null) + IEnumerable? allowedViewers = null, + IEnumerable? allowedEditorGroups = null, + IEnumerable? allowedViewerGroups = null) { if (string.IsNullOrWhiteSpace(title)) { @@ -315,6 +371,8 @@ await CreatePageReferenceAsync(dataStore, wikiId, title, options.CategoryNamespa owner, allowedEditors, allowedViewers, + allowedEditorGroups, + allowedViewerGroups, wikiLinks) .ConfigureAwait(false); @@ -331,6 +389,8 @@ await CreatePageReferenceAsync(dataStore, wikiId, title, options.CategoryNamespa owner, allowedEditors, allowedViewers, + allowedEditorGroups, + allowedViewerGroups, categories, transclusions); await dataStore.StoreItemAsync(category).ConfigureAwait(false); @@ -398,7 +458,7 @@ await UpdateReferencesAsync( /// /// /// - /// The user(s) and/or group(s) allowed to edit this category. + /// The users allowed to edit this category. /// /// /// If the category can be edited by anyone. @@ -411,7 +471,33 @@ await UpdateReferencesAsync( /// /// /// - /// The user(s) and/or group(s) allowed to view this category. + /// The users allowed to view this category. + /// + /// + /// If the category can be viewed by anyone. + /// + /// + /// If non- the category can only be viewed by those listed, plus its + /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to view the category. + /// + /// + /// + /// + /// The groups allowed to edit this category. + /// + /// + /// If the category can be edited by anyone. + /// + /// + /// If non- the category can only be edited by those listed, plus its + /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to make edits. + /// + /// + /// + /// + /// The groups allowed to view this category. /// /// /// If the category can be viewed by anyone. @@ -432,7 +518,9 @@ public async Task ReviseAsync( bool isDeleted = false, string? owner = null, IEnumerable? allowedEditors = null, - IEnumerable? allowedViewers = null) + IEnumerable? allowedViewers = null, + IEnumerable? allowedEditorGroups = null, + IEnumerable? allowedViewerGroups = null) { if (isDeleted && ChildIds.Count > 0) { @@ -527,6 +615,8 @@ await AddPageLinksAsync(dataStore, Id, WikiLinks.Except(previousWikiLinks)) owner, allowedEditors, allowedViewers, + allowedEditorGroups, + allowedViewerGroups, WikiLinks, Categories) .ConfigureAwait(false)) diff --git a/src/Models/WikiFile.cs b/src/Models/WikiFile.cs index 305fbc7..4c34791 100644 --- a/src/Models/WikiFile.cs +++ b/src/Models/WikiFile.cs @@ -55,7 +55,7 @@ public sealed class WikiFile : Article public string Uploader { get; set; } /// - /// Initializes a new instance of . + /// Initializes a new instance of . /// /// The item's . /// @@ -96,34 +96,54 @@ public sealed class WikiFile : Article /// /// /// - /// The user(s) and/or group(s) allowed to edit this article. + /// The users allowed to edit this file. /// /// - /// If the article can be edited by anyone. + /// If the file can be edited by anyone. /// /// - /// If non- the article can only be edited by those listed, plus its + /// If non- the file can only be edited by those listed, plus its /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to make edits. /// + /// + /// + /// + /// The users allowed to view this file. + /// + /// + /// If the file can be viewed by anyone. + /// /// - /// Cannot be set if the is . + /// If non- the file can only be viewed by those listed, plus its + /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to view the file. /// /// - /// + /// /// - /// The user(s) and/or group(s) allowed to view this article. + /// The groups allowed to edit this file. /// /// - /// If the article can be viewed by anyone. + /// If the file can be edited by anyone. /// /// - /// If non- the article can only be viewed by those listed, plus its + /// If non- the file can only be edited by those listed, plus its /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to view the article. + /// langword="null"/>) list allows only the owner to make edits. + /// + /// + /// + /// + /// The groups allowed to view this file. /// /// - /// Cannot be set if the is . + /// If the file can be viewed by anyone. + /// + /// + /// If non- the file can only be viewed by those listed, plus its + /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to view the file. /// /// /// @@ -153,6 +173,8 @@ public WikiFile( string? owner, IReadOnlyCollection? allowedEditors, IReadOnlyCollection? allowedViewers, + IReadOnlyCollection? allowedEditorGroups, + IReadOnlyCollection? allowedViewerGroups, IReadOnlyCollection categories, IReadOnlyList? transclusions) : base( id, @@ -167,6 +189,8 @@ public WikiFile( owner, allowedEditors, allowedViewers, + allowedEditorGroups, + allowedViewerGroups, null, null, false, @@ -197,6 +221,8 @@ private WikiFile( string? owner = null, IEnumerable? allowedEditors = null, IEnumerable? allowedViewers = null, + IEnumerable? allowedEditorGroups = null, + IEnumerable? allowedViewerGroups = null, IList? categories = null, IList? transclusions = null) : base( id, @@ -211,6 +237,8 @@ private WikiFile( owner, allowedEditors, allowedViewers, + allowedEditorGroups, + allowedViewerGroups, categories, transclusions) { @@ -285,7 +313,7 @@ private WikiFile( /// /// /// - /// The user(s) and/or group(s) allowed to edit this file. + /// The users allowed to edit this file. /// /// /// If the file can be edited by anyone. @@ -298,7 +326,33 @@ private WikiFile( /// /// /// - /// The user(s) and/or group(s) allowed to view this file. + /// The users allowed to view this file. + /// + /// + /// If the file can be viewed by anyone. + /// + /// + /// If non- the file can only be viewed by those listed, plus its + /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to view the file. + /// + /// + /// + /// + /// The groups allowed to edit this file. + /// + /// + /// If the file can be edited by anyone. + /// + /// + /// If non- the file can only be edited by those listed, plus its + /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to make edits. + /// + /// + /// + /// + /// The groups allowed to view this file. /// /// /// If the file can be viewed by anyone. @@ -321,7 +375,9 @@ public static async Task NewAsync( string? revisionComment = null, string? owner = null, IEnumerable? allowedEditors = null, - IEnumerable? allowedViewers = null) + IEnumerable? allowedViewers = null, + IEnumerable? allowedEditorGroups = null, + IEnumerable? allowedViewerGroups = null) { if (string.IsNullOrWhiteSpace(title)) { @@ -370,6 +426,8 @@ await CreatePageReferenceAsync(dataStore, wikiId, title, options.FileNamespace) owner, allowedEditors, allowedViewers, + allowedEditorGroups, + allowedViewerGroups, wikiLinks) .ConfigureAwait(false); @@ -390,6 +448,8 @@ await CreatePageReferenceAsync(dataStore, wikiId, title, options.FileNamespace) owner, allowedEditors, allowedViewers, + allowedEditorGroups, + allowedViewerGroups, categories, transclusions); await dataStore.StoreItemAsync(file).ConfigureAwait(false); @@ -462,7 +522,7 @@ await UpdateReferencesAsync( /// /// /// - /// The user(s) and/or group(s) allowed to edit this file. + /// The users allowed to edit this file. /// /// /// If the file can be edited by anyone. @@ -475,7 +535,33 @@ await UpdateReferencesAsync( /// /// /// - /// The user(s) and/or group(s) allowed to view this file. + /// The users allowed to view this file. + /// + /// + /// If the file can be viewed by anyone. + /// + /// + /// If non- the file can only be viewed by those listed, plus its + /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to view the file. + /// + /// + /// + /// + /// The groups allowed to edit this file. + /// + /// + /// If the file can be edited by anyone. + /// + /// + /// If non- the file can only be edited by those listed, plus its + /// owner (regardless of whether the owner is explicitly listed). An empty (but non-) list allows only the owner to make edits. + /// + /// + /// + /// + /// The groups allowed to view this file. /// /// /// If the file can be viewed by anyone. @@ -499,7 +585,9 @@ public async Task ReviseAsync( bool isDeleted = false, string? owner = null, IEnumerable? allowedEditors = null, - IEnumerable? allowedViewers = null) + IEnumerable? allowedViewers = null, + IEnumerable? allowedEditorGroups = null, + IEnumerable? allowedViewerGroups = null) { title ??= title?.ToWikiTitleCase() ?? Title; @@ -611,6 +699,8 @@ await AddPageLinksAsync(dataStore, Id, WikiLinks.Except(previousWikiLinks)) owner, allowedEditors, allowedViewers, + allowedEditorGroups, + allowedViewerGroups, WikiLinks, Categories) .ConfigureAwait(false))