Exemple #1
0
        public IActionResult Create([FromBody] PackageFeaturePackage PackageFeaturePackage)
        {
            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"))
                {
                    PackageFeaturePackage.Id       = Guid.NewGuid() + "";
                    PackageFeaturePackage.IsDelete = false;
                    return(Ok(_repository.Create(PackageFeaturePackage)));
                }
            }
            else
            {
                return(Forbid());
            }
            return(Forbid());
        }
 public IActionResult Create([FromBody] PackageFeaturePackage PackageFeaturePackage)
 {
     PackageFeaturePackage.Id       = Guid.NewGuid() + "";
     PackageFeaturePackage.IsDelete = false;
     return(Ok(_repository.Create(PackageFeaturePackage)));
 }