public IActionResult Update(string id, [FromBody] FeaturePackage FeaturePackage) { var claims = User.Claims.Select(claim => new { claim.Type, claim.Value }).ToDictionary(t => t.Type, t => t.Value); if (claims.ContainsKey("name")) { if (claims["name"].Equals("ADMIN") || claims["name"].Equals("MANAGER")) { return(Ok(_repository.Update(id, FeaturePackage))); } } else { return(Forbid()); } return(Forbid()); }
public IActionResult Update(string id, [FromBody] FeaturePackage FeaturePackage) { return(Ok(_repository.Update(id, FeaturePackage))); }