Skip to content

Commit

Permalink
allow ngo admins to execute some actions (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
aniri authored Dec 4, 2020
1 parent a4a5bf8 commit 22e0849
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public DataExportController(IMediator mediator, ILogger<DataExportController> lo
/// </summary>
/// <returns></returns>
[HttpGet("all")]
[Authorize("Organizer")]
[Authorize("NgoAdmin")]
public async Task<IActionResult> GetAllData(int? idNgo, int? idObserver, int? pollingStationNumber, string county, DateTime? from, DateTime? to)
{
var filter = new GetDataForExport
Expand Down Expand Up @@ -65,7 +65,7 @@ public async Task<IActionResult> GetAllData(int? idNgo, int? idObserver, int? po
}

[HttpGet("all/notes")]
[Authorize("Organizer")]
[Authorize("NgoAdmin")]
public async Task<IActionResult> GetAllNotes(int? idNgo, int? idObserver, int? pollingStationNumber, string county, DateTime? from, DateTime? to)
{
var filter = new GetNotesForExport
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public async Task<dynamic> RegisterTokenAsync(NotificationRegistrationDataModel
}

[HttpPost]
[Authorize("Organizer")]
[Authorize("NgoAdmin")]
[Route("send")]
public async Task<dynamic> Send([FromBody]NotificationNewModel newNotificationModel)
{
Expand All @@ -60,7 +60,7 @@ public async Task<dynamic> Send([FromBody]NotificationNewModel newNotificationMo
}

[HttpPost]
[Authorize("Organizer")]
[Authorize("NgoAdmin")]
[Route("send/all")]
public async Task<dynamic> SendToAll([FromBody]NotificationForAllNewModel model)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public async Task<int> Import(IFormFile file, [FromForm] int ongId)
/// <param name="model"></param>
/// <returns>Boolean indicating whether or not the observer was added successfully.</returns>
[HttpPost]
[Authorize("Organizer")]
[Authorize("NgoAdmin")]
[Produces(type: typeof(int))]
public async Task<IActionResult> NewObserver(NewObserverModel model)
{
Expand All @@ -115,7 +115,7 @@ public async Task<IActionResult> NewObserver(NewObserverModel model)
/// <param name="model"></param>
/// <returns>Boolean indicating whether or not the observer was changed successfully</returns>
[HttpPut]
[Authorize("Organizer")]
[Authorize("NgoAdmin")]
[Produces(type: typeof(bool))]
public async Task<IActionResult> EditObserver([FromBody] EditObserverModel model)
{
Expand Down Expand Up @@ -148,7 +148,7 @@ public async Task<IActionResult> EditObserver([FromBody] EditObserverModel model
/// <param name="id">The Observer id</param>
/// <returns>Boolean indicating whether or not the observer was deleted successfully</returns>
[HttpDelete]
[Authorize("Organizer")]
[Authorize("NgoAdmin")]
[Produces(type: typeof(bool))]
public async Task<IActionResult> DeleteObserver(int id)
{
Expand Down Expand Up @@ -212,7 +212,7 @@ public async Task<IActionResult> RemoveObserverDeviceId(int id)

[HttpPost]
[Route("reset")]
[Authorize("Organizer")]
[Authorize("NgoAdmin")]
public async Task<IActionResult> Reset([FromBody] ResetModel model)
{
if (string.IsNullOrEmpty(model.Action) || string.IsNullOrEmpty(model.PhoneNumber))
Expand Down

0 comments on commit 22e0849

Please sign in to comment.