This commit is contained in:
2022-01-06 00:26:34 +00:00
parent 1da81822db
commit b20e7b0977
4 changed files with 725 additions and 17 deletions

View File

@@ -4,6 +4,8 @@ using System;
using AyaNova.Util;
using AyaNova.Api.ControllerHelpers;
using Microsoft.AspNetCore.Authorization;
using System.Linq;
using AyaNova.Biz;
namespace AyaNova.Api.Controllers
{
@@ -132,6 +134,24 @@ namespace AyaNova.Api.Controllers
});
}
/// <summary>
/// Get list of types and roles required
/// </summary>
/// <returns>A list of AyaType role rights</returns>
[HttpGet("role-rights")]
public ActionResult RoleRights()
{
return Ok(new
{
data = new
{
AyaTypes = BizRoles.roles.OrderBy(z => z.Key.ToString()).Select(z => new { AyaType = z.Key.ToString(), Change = z.Value.Change.ToString(), ReadFullRecord = z.Value.ReadFullRecord.ToString(), Select = z.Value.Select.ToString() }).ToList()
}
});
}
#if (DEBUG)
/// <summary>
/// Get build mode of server, used for automated testing purposes