final draft of plugin backoffice modification

This commit is contained in:
2020-05-14 13:32:33 +02:00
parent a2c2621d71
commit c4fb8a9450
33 changed files with 192 additions and 353 deletions
@@ -3,6 +3,7 @@ using System.Threading.Tasks;
using zero.Core.Api;
using zero.Core.Entities;
using zero.Core.Identity;
using zero.Core.Options;
using zero.Web.Models;
namespace zero.Web.Controllers
@@ -55,7 +56,7 @@ namespace zero.Web.Controllers
/// </summary>
public IActionResult GetAllFeatures()
{
return Json(Options.Backoffice.Features);
return Json(Options.Features.GetAllItems());
}
@@ -7,6 +7,7 @@ using zero.Core.Api;
using zero.Core.Entities;
using zero.Core.Identity;
using zero.Core.Mapper;
using zero.Core.Options;
using zero.Web.Filters;
using zero.Web.Mapper;
using zero.Web.Models;
+3 -2
View File
@@ -9,6 +9,7 @@ using zero.Core;
using zero.Core.Api;
using zero.Core.Entities;
using zero.Core.Identity;
using zero.Core.Options;
using zero.Core.Plugins;
using zero.Core.Renderer;
@@ -34,7 +35,7 @@ namespace zero.Web.Controllers
[HttpGet]
[ZeroAuthorize(false)]
public IActionResult GetPlugins([FromServices] IEnumerable<ZeroPlugin> plugins)
public IActionResult GetPlugins([FromServices] IEnumerable<IZeroPlugin> plugins)
{
return Json(plugins);
}
@@ -103,7 +104,7 @@ namespace zero.Web.Controllers
{
Space space = SpacesApi.GetByAlias(alias);
AbstractGenericRenderer renderer = Options.Backoffice.Renderers.FirstOrDefault(x => x.TargetType == space.Type);
AbstractGenericRenderer renderer = Options.Renderers.GetAllItems().FirstOrDefault(x => x.TargetType == space.Type);
if (renderer == null)
{
+4 -2
View File
@@ -14,14 +14,16 @@ namespace zero.Web.Controllers
IAuthenticationApi AuthenticationApi;
IUserRolesApi RolesApi;
ILanguagesApi LanguagesApi;
IPermissionsApi PermissionsApi;
public UsersController(IUserApi api, IAuthenticationApi authenticationApi, IUserRolesApi rolesApi, ILanguagesApi languagesApi)
public UsersController(IUserApi api, IAuthenticationApi authenticationApi, IUserRolesApi rolesApi, ILanguagesApi languagesApi, IPermissionsApi permissionsApi)
{
Api = api;
AuthenticationApi = authenticationApi;
RolesApi = rolesApi;
LanguagesApi = languagesApi;
PermissionsApi = permissionsApi;
}
@@ -58,7 +60,7 @@ namespace zero.Web.Controllers
/// </summary>
public IActionResult GetAllPermissions()
{
return Json(Options.Backoffice.Permissions);
return Json(PermissionsApi.GetAll());
}