++
This commit is contained in:
@@ -15,6 +15,6 @@ public class CountriesController : ZeroBackofficeCollectionController<Country, I
|
||||
public override Task<ListResult<Country>> GetByQuery([FromQuery] ListBackofficeQuery<Country> query)
|
||||
{
|
||||
query.OrderQuery = q => q.OrderByDescending(x => x.IsPreferred).ThenBy(x => x.Name);
|
||||
return Collection.Load<zero_Countries>(query);
|
||||
return Collection.Load<zero_Backoffice_Countries_Listing>(query);
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
namespace zero.Configuration;
|
||||
|
||||
public class PermissionOptions : OptionsEnumerable<PermissionCollection>, 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<T>(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<Permission> items = collection.Items;
|
||||
|
||||
if (index > -1 && index < items.Count)
|
||||
{
|
||||
items.Insert(index, permission);
|
||||
}
|
||||
else
|
||||
{
|
||||
items.Add(permission);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -78,9 +78,6 @@ public class ZeroOptions : IZeroOptions
|
||||
///// <inheritdoc />
|
||||
//public ModuleOptions Modules { get; private set; }
|
||||
|
||||
///// <inheritdoc />
|
||||
//public PermissionOptions Permissions { get; private set; }
|
||||
|
||||
///// <inheritdoc />
|
||||
//public SettingsOptions Settings { get; private set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user