hidden activity
This commit is contained in:
parent
1b8963c105
commit
6ca18b65f4
25 changed files with 5706 additions and 13 deletions
|
|
@ -4,6 +4,8 @@ using Microsoft.AspNet.Mvc;
|
|||
using System.Linq;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Models.Workflow;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
|
|
@ -16,9 +18,21 @@ namespace Yavsc.Controllers
|
|||
{
|
||||
dbContext = context;
|
||||
}
|
||||
public IEnumerable<PerformerProfile> Get()
|
||||
|
||||
/// <summary>
|
||||
/// Lists profiles on an activity code
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[Authorize(Roles="Performer")]
|
||||
public IActionResult Get(string id)
|
||||
{
|
||||
return dbContext.Performers.Where(p=>p.Active && p.AcceptPublicContact);
|
||||
if (id==null)
|
||||
{
|
||||
ModelState.AddModelError("id","Specifier un code activité");
|
||||
return new BadRequestObjectResult(ModelState);
|
||||
}
|
||||
return Ok(dbContext.Performers.Where(p=>p.Active && p.PerformerId == id));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue