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