Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8470337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:29:18+00:00 2026-06-10T16:29:18+00:00

I am just confused why it is bad practice to use domain objects in

  • 0

I am just confused why it is bad practice to use domain objects in views? I am told it can leave to model binding attacks but I’m not exactly sure what this is or how it can be done. I also don’t quite understand how copying the properties to a viewmodel will solve this issue.

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T16:29:20+00:00Added an answer on June 10, 2026 at 4:29 pm

    Your domain objects often contain properties that define flags like isAdmin, isDeleted, isAuthorized or any other security or sensitive info that you may not want the final user to mess with, even if you only show it in a readonly state you are giving away the property name in the view/html, giving some ‘smart users’ the chance to play with your POST actions, and if you didn’t take the right precautions this may lead to security holes.

    If you use a ViewModel you are forced to do a remap from the ViewModel <-> Model (Domain objects), in this remapping you can make sure that the assignments are just the ones you want from any particular user something like:

    if(CurrentUser.IsAdmin)
    {
       //Assign just if the current user is admin
       Model.IsDeleted = ViewModel.Delete;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just confused about what's the padding mode used when use crypto:des_ecb_encrypt/2 in erlang.
Just wondering when do you actually use $.get(index); I am a bit confused on
hello i have just start using Raphael but i'm very confused in the following
I'm really confused, I just wrote this x = 0 y = 42 #Can
Possible Duplicate: Concatenate Two NSDate String values Just confused that is there any default
I have a question about my C++ homework. I am just confused about *this.
Just a little confused here... I have a function in postgres, and when I'm
just a bit confused by this code var counter = function() { //... var
I've just started playing with PowerMock and EasyMock and I'm a bit confused about
I'm just starting to try to pick up the J language, and am confused

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.