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 7936031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:05:24+00:00 2026-06-03T22:05:24+00:00

Is it possible to restrict code access for certain .NET functionality/classes? For example, I

  • 0

Is it possible to restrict code access for certain .NET functionality/classes?

For example, I have plugin modules for my MVC CMS. I wouldn’t want 3rd party modules able to use the File class directly. I would want to wrap it up in an API so that the module can only access files in it’s own designated ‘root’ folder (sandbox). Otherwise, the module would have file access to the entire server, including the CMS system files.

Is there a way to restrict certain namespaces from using particular features of the framework? Or is there a different approach that I should take?

To give you an overview:

The CMS namespace is MyCms

All modules take the namespace MyCms.Module.xxxxx

Modules are just standard MVC structures that are brought into the name main MVC namespace, and routes are automatically set up to route requests to the module controllers.

Therefore the modules have default access to the ASP.NET framework. I want to be able to restrict MyCms.Module.xxxxx namespaces from being able to do certain things, if that is possible.

Have I taken the wrong approach here? I’m not keen to change the infrastructure to be honest, but may be forced to if I can’t properly secure the main CMS infrastructure from naughty modules.

  • 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-03T22:05:26+00:00Added an answer on June 3, 2026 at 10:05 pm

    Yeah, the .net/ the common language runtime supports a wide set of privilege restrictions and customizations you can put in for what code can do what.

    This is an overview of how it worked prior to .net 4

    http://msdn.microsoft.com/en-us/library/.aspx

    This is how it works now

    This stuff is a little complicated and my work with it was limited to bipassing some of it for test cases I had to write, but it was written to provide precisely the functionality you seek.

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

Sidebar

Related Questions

Is possible to restrict access to my .NET DLL library? My application has more
Possible Duplicate: before_filter :require_owner I am trying to restrict access to certain actions using
Is it possible to restrict direct access to PHP file if I use jquery
I have a model and I'd like to restrict access to objects based on
I'd like to restrict the possible values that the following patient_id variable can have(for
Is it possible to restrict access to a MS Access db on a users
This question is more or less the same as Restrict Certain Java Code in
Is it possible to restrict access to a Service such that a client can
Is it possible to restict the -pedantic switch for certain files? For example I
Is it possible to restrict domains that are allowed to send POST info to

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.