public CommonApiResponse <string> Delete(PermissionCrudView permissionView)
        {
            jwt = ViewBag.Jwt;
            CoreFaces.Helper.Result <Permission> result = _permissionService.Delete(jwt.UserId, permissionView.Id);
            Permission p = result.Data;

            if (result.Status)
            {
                return(CommonApiResponse <string> .Create(Response, System.Net.HttpStatusCode.OK, true, "Success.", result.ErrorList));
            }
            else
            {
                return(CommonApiResponse <string> .Create(Response, System.Net.HttpStatusCode.Conflict, false, null, result.ErrorList));
            }
        }
        public CommonApiResponse <Permission> Put(PermissionCrudView permissionView)
        {
            jwt = ViewBag.Jwt;
            Permission permission = new Permission();

            permission.Id          = permissionView.Id;
            permission.UserId      = jwt.UserId;
            permission.Name        = permissionView.Name;
            permission.Description = permissionView.Description;

            bool result = _permissionService.Update(permission);

            if (result)
            {
                return(CommonApiResponse <Permission> .Create(Response, System.Net.HttpStatusCode.OK, true, permission, null));
            }

            return(CommonApiResponse <Permission> .Create(Response, System.Net.HttpStatusCode.OK, false, null, FluentValidationHelper.GenerateErrorList("An error occurred.")));
        }