add support for API permissions at the UI layer - including ability to delegate user, role, profile management
This commit is contained in:
@ -1,32 +0,0 @@
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Documentation;
|
||||
using Oqtane.Shared;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||
public class ApiService : ServiceBase, IApiService
|
||||
{
|
||||
public ApiService(HttpClient http, SiteState siteState) : base(http, siteState) { }
|
||||
|
||||
private string Apiurl => CreateApiUrl("Api");
|
||||
|
||||
public async Task<List<Api>> GetApisAsync(int siteId)
|
||||
{
|
||||
return await GetJsonAsync<List<Api>>($"{Apiurl}?siteid={siteId}");
|
||||
}
|
||||
|
||||
public async Task<Api> GetApiAsync(int siteId, string entityName)
|
||||
{
|
||||
return await GetJsonAsync<Api>($"{Apiurl}/{siteId}/{entityName}");
|
||||
}
|
||||
|
||||
public async Task UpdateApiAsync(Api api)
|
||||
{
|
||||
await PostJsonAsync(Apiurl, api);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Oqtane.Models;
|
||||
|
||||
namespace Oqtane.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Service to retrieve and update API information.
|
||||
/// </summary>
|
||||
public interface IApiService
|
||||
{
|
||||
/// <summary>
|
||||
/// returns a list of APIs
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<Api>> GetApisAsync(int siteId);
|
||||
|
||||
/// <summary>
|
||||
/// returns a specific API
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<Api> GetApiAsync(int siteId, string entityName);
|
||||
|
||||
/// <summary>
|
||||
/// Updates an API
|
||||
/// </summary>
|
||||
/// <param name="api"></param>
|
||||
/// <returns></returns>
|
||||
Task UpdateApiAsync(Api api);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user