Example #1
0
        public async Task <ActionResult> AddPermissionType(string permissionTypeName = "")
        {
            Console.WriteLine("f**k");
            if (permissionTypeName == null || permissionTypeName == "")
            {
                return(BadRequest());
            }


            var result = await _roleSvc.AddRolePermissionAsync(permissionTypeName);

            return(RedirectToAction("Permissions"));
            // return View("Index", _adminBaseViewModel);
        }
Example #2
0
        public async Task <IActionResult> AddRolePermission([FromRoute] string rolePermissionName)
        {
            try
            {
                var resultError = await _roleSvc.AddRolePermissionAsync(rolePermissionName);

                if (!resultError)
                {
                    Log.Information("{Info}", $"Role type {rolePermissionName} Added.");
                    return(Ok());
                }
            }
            catch (Exception ex)
            {
                Log.Error("An error occurred while seeding the database  {Error} {StackTrace} {InnerException} {Source}",
                          ex.Message, ex.StackTrace, ex.InnerException, ex.Source);
                return(BadRequest());
            }
            return(BadRequest());
        }