Added grant permissions for streaming songs #7
This commit is contained in:
@@ -39,6 +39,7 @@ namespace Icarus.Controllers.V1
|
|||||||
|
|
||||||
#region HTTP endpoints
|
#region HTTP endpoints
|
||||||
[HttpGet("{id}")]
|
[HttpGet("{id}")]
|
||||||
|
[Authorize("stream:songs")]
|
||||||
public async Task<IActionResult> Get(int id)
|
public async Task<IActionResult> Get(int id)
|
||||||
{
|
{
|
||||||
var songStore= HttpContext
|
var songStore= HttpContext
|
||||||
|
|||||||
@@ -92,6 +92,11 @@ namespace Icarus
|
|||||||
policy
|
policy
|
||||||
.Requirements
|
.Requirements
|
||||||
.Add(new HasScopeRequirement("read:albums", domain)));
|
.Add(new HasScopeRequirement("read:albums", domain)));
|
||||||
|
|
||||||
|
options.AddPolicy("stream:songs", policy =>
|
||||||
|
policy
|
||||||
|
.Requirements
|
||||||
|
.Add(new HasScopeRequirement("stream:songs", domain)));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user