public async Task <IActionResult> Create(int patrolId, string name, int?copyFromPlanId) { if (User.RoleInPatrol(patrolId).CanMaintainPlans()) { var plan = await _planService.CreatePlan(name, patrolId, copyFromPlanId); return(Ok(plan)); } else { return(Forbid()); } }
/// <summary> /// Creates new plan in databse /// </summary> /// <param name="plan">Object to be saved to database</param> public Guid CreatePlan(Plan plan) { return(_planService.CreatePlan(plan)); }