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

  • Home
  • SEARCH
  • 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 681447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:29:04+00:00 2026-05-14T01:29:04+00:00

I am building a web site in C# using asp.NET MVC How can I

  • 0

I am building a web site in C# using asp.NET MVC

How can I secure that no unauthorized persons can access my methods?

What I mean is that I want to make sure that only admins can create articles on my page. If I put this logic in the method actually adding this to the database, wouldn’t I have business logic in my data layer?

Is it a good practise to have a seperate security layer that is always in between of the data layer and the business layer to make?

The problem is that if I protect at a higher level I will have to have checks on many places and it is more likely that I miss one place and users can bypass security.

Thanks!

  • 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-05-14T01:29:05+00:00Added an answer on May 14, 2026 at 1:29 am

    Authorize filters (as pmarflee said) are sort of the canonical example of how to secure your controllers, though that doesn’t always satisfy your requirements (e.g. if you’re exposing your model through other means such as if you’re also exposing a WCF service).

    The more global and flexible means is to require a security service somewhere (your choice where, but commonly in either the controller or repository base) and then pass in a user context somehow (either through params or constructor). yes, that means you have to be sure to call that service in each action, but it’s pretty hard to avoid that unless you decide to go with some sort of aspect-oriented programming container.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Asp.net menu control for the web site that I am currently
I'm building an ASP.NET MVC site where I'm using Lucene.Net for search queries. I
I am building an ASP.NET MVC application using the 1.0 release using Visual Web
I am building a site using ASP.NET MVC 2. The site itself needs to
I'm building a website in ASP.Net, using MVC, and need to list a set
I'm looking at building a templating engine for my website. I'm using ASP.NET MVC
I am building my first ASP.Net web application project in VS2010. The site has
Building an MVC 2.0 web site and using Content Delivery Network (CDN) in my
I am currently building a website in ASP.NET MVC. I am trying to access
i am building a website using asp.net mvc and jquery. as a best practice

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.