This commit is contained in:
@@ -43,45 +43,27 @@ namespace AyaNova.Api.Controllers
|
||||
|
||||
/// <summary>
|
||||
/// Get roles
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
/// <param name="AsJson">Return as compact JSON format</param>
|
||||
/// <returns>Dictionary list of AyaNova object types and their authorization role rights in AyaNova</returns>
|
||||
[HttpGet("list")]
|
||||
public ActionResult GetRoles()
|
||||
public ActionResult GetRoles([FromQuery] bool AsJson = false)
|
||||
{
|
||||
if (!serverState.IsOpen)
|
||||
{
|
||||
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
|
||||
}
|
||||
|
||||
|
||||
|
||||
return Ok(ApiOkResponse.Response(BizRoles.roles, true));
|
||||
//as json for client end of things
|
||||
if (AsJson)
|
||||
return Ok(ApiOkResponse.Response(Newtonsoft.Json.JsonConvert.SerializeObject(BizRoles.roles, Newtonsoft.Json.Formatting.None), true));
|
||||
else
|
||||
return Ok(ApiOkResponse.Response(BizRoles.roles, true));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// /// <summary>
|
||||
// /// Get all possible enumerated values picklist key names
|
||||
// /// </summary>
|
||||
// /// <returns>List of AyaNova enumerated type list key names that can be fetched from the AyaEnumPickList/GetPickListRoute</returns>
|
||||
// [HttpGet("listkeys")]
|
||||
// public ActionResult GetTypesList()
|
||||
// {
|
||||
// if (!serverState.IsOpen)
|
||||
// {
|
||||
// return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
|
||||
// }
|
||||
|
||||
// List<KeyValuePair<string, string>> ret = new List<KeyValuePair<string, string>>();
|
||||
// ret.Add(new KeyValuePair<string, string>("usertypes", "AyaNova user account types"));
|
||||
// ret.Add(new KeyValuePair<string, string>("authorizationroles", "AyaNova user account role types"));
|
||||
// ret.Add(new KeyValuePair<string, string>("AyaType", "All AyaNova object types, use the AyaTypeController route to fetch these"));
|
||||
// ret.Add(new KeyValuePair<string, string>("datatypes", "Types of data used in AyaNova for display and formatting UI purposes"));
|
||||
|
||||
// return Ok(ApiOkResponse.Response(ret, true));
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user