From d4e74fac6cb7e59ceef0d076272139dfd26288f7 Mon Sep 17 00:00:00 2001 From: Tobias Klika Date: Tue, 23 Nov 2021 01:04:51 +0100 Subject: [PATCH] ++ --- .../Modules/Countries/CountriesEndpoint.cs | 2 +- .../ConfigurationParts/PermissionOptions.cs | 52 ------------------- zero.Core/Configuration/ZeroOptions.cs | 3 -- 3 files changed, 1 insertion(+), 56 deletions(-) delete mode 100644 zero.Core/Configuration/ConfigurationParts/PermissionOptions.cs diff --git a/zero.Backoffice/Modules/Countries/CountriesEndpoint.cs b/zero.Backoffice/Modules/Countries/CountriesEndpoint.cs index 0d863475..3cbaa843 100644 --- a/zero.Backoffice/Modules/Countries/CountriesEndpoint.cs +++ b/zero.Backoffice/Modules/Countries/CountriesEndpoint.cs @@ -15,6 +15,6 @@ public class CountriesController : ZeroBackofficeCollectionController> GetByQuery([FromQuery] ListBackofficeQuery query) { query.OrderQuery = q => q.OrderByDescending(x => x.IsPreferred).ThenBy(x => x.Name); - return Collection.Load(query); + return Collection.Load(query); } } \ No newline at end of file diff --git a/zero.Core/Configuration/ConfigurationParts/PermissionOptions.cs b/zero.Core/Configuration/ConfigurationParts/PermissionOptions.cs deleted file mode 100644 index d90fe9f1..00000000 --- a/zero.Core/Configuration/ConfigurationParts/PermissionOptions.cs +++ /dev/null @@ -1,52 +0,0 @@ -namespace zero.Configuration; - -public class PermissionOptions : OptionsEnumerable, IOptionsEnumerable -{ - public void AddCollection(PermissionCollection collection, int index = -1) - { - if (index > -1 && index < Items.Count) - { - Items.Insert(index, collection); - } - else - { - Items.Add(collection); - } - } - - - public void AddCollection(int index = -1) where T : PermissionCollection, new() - { - if (index > -1 && index < Items.Count) - { - Items.Insert(index, new T()); - } - else - { - Items.Add(new T()); - } - } - - - public void Add(string collectionAlias, Permission permission, int index = -1) - { - PermissionCollection collection = Items.FirstOrDefault(x => x.Alias.Equals(collectionAlias, StringComparison.InvariantCultureIgnoreCase)); - - if (collection == null) - { - // TODO handle error - return; - } - - IList items = collection.Items; - - if (index > -1 && index < items.Count) - { - items.Insert(index, permission); - } - else - { - items.Add(permission); - } - } -} \ No newline at end of file diff --git a/zero.Core/Configuration/ZeroOptions.cs b/zero.Core/Configuration/ZeroOptions.cs index 6c3e86aa..e23545be 100644 --- a/zero.Core/Configuration/ZeroOptions.cs +++ b/zero.Core/Configuration/ZeroOptions.cs @@ -78,9 +78,6 @@ public class ZeroOptions : IZeroOptions ///// //public ModuleOptions Modules { get; private set; } - ///// - //public PermissionOptions Permissions { get; private set; } - ///// //public SettingsOptions Settings { get; private set; }