...
This commit is contained in:
parent
df55836c58
commit
1befc2e053
38 changed files with 427 additions and 309 deletions
|
|
@ -245,9 +245,9 @@ namespace isnd.Controllers
|
|||
{
|
||||
var user = await _userManager.FindByNameAsync(username);
|
||||
var roles = await _userManager.GetRolesAsync(user);
|
||||
if (!roles.Contains(Constants.AdministratorRoleName))
|
||||
if (!roles.Contains(IsndConstants.AdministratorRoleName))
|
||||
{
|
||||
await _userManager.AddToRoleAsync(user, Constants.AdministratorRoleName);
|
||||
await _userManager.AddToRoleAsync(user, IsndConstants.AdministratorRoleName);
|
||||
|
||||
}
|
||||
return Ok();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace isnd.Controllers
|
|||
// TODO Web hook CI
|
||||
public class NewUpdateController : Controller
|
||||
{
|
||||
[Authorize(Policy = Constants.RequireAdminPolicyName)]
|
||||
[Authorize(Policy = IsndConstants.RequireAdminPolicyName)]
|
||||
public IActionResult NewRelease(NewReleaseInfo version)
|
||||
{
|
||||
throw new NotImplementedException("web hook");
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ using isnd.Services;
|
|||
using isnd.ViewModels;
|
||||
using System.Threading.Tasks;
|
||||
using isnd.Interfaces;
|
||||
using isn.Abstract;
|
||||
|
||||
namespace isnd.Controllers
|
||||
{
|
||||
|
|
@ -54,7 +55,7 @@ namespace isnd.Controllers
|
|||
[HttpGet(_pkgRootPrefix + ApiConfig.Base)]
|
||||
public IActionResult ApiIndex()
|
||||
{
|
||||
return Ok(new { version = "3.0.0", resources = _resources });
|
||||
return Ok(new ApiIndexViewModel{ Version = "3.0.0", Resources = _resources });
|
||||
}
|
||||
|
||||
// GET /autocomplete?id=isn.protocol&prerelease=true
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
using Newtonsoft.Json;
|
||||
|
||||
namespace isnd.Controllers
|
||||
{
|
||||
public class Resource
|
||||
{
|
||||
[JsonProperty("@id")]
|
||||
public string Id {get; set; }
|
||||
|
||||
[JsonProperty("@type")]
|
||||
public string Type {get; set; }
|
||||
|
||||
[JsonProperty("comment")]
|
||||
public string Comment {get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue