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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:02:45+00:00 2026-05-19T17:02:45+00:00

I have a asp.net mvc project and persistent is handled by repositories . Form

  • 0

I have a asp.net mvc project and persistent is handled by repositories . Form authentication is used. Now I need implement authorization . For example , I need to ensure a manager user can only open his/her taskes and assign workers to the taskes. A worker will only see taskes that have been assigned to him/her. A super-moderator can edit everything.
Is there any ready to use framework that allow me to define permissions ?

I am in the process of evaluating Ayende Rhino Security . Where can I get more examples codes ? What is your opinion on Rhino Security ?
My project use Linq to SQL and has not made use of NHibernate. Can Rhino Security works without NHibernate ?

  • 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-19T17:02:46+00:00Added an answer on May 19, 2026 at 5:02 pm

    I am afraid, Rhino Security depends on Nhibernate to work.
    I have been evaluating Rhino Security for a couple of months and, at the end, I’ve decided to use it cause it’s a really really good product.
    You can find good an useful informations on Ayende’s blog or here.
    I have straggled a bit to integrate it with StructureMap (instead of Castle Windsor). You can find some info here.
    To do what you’re trying to achieve you have to define a class which implements the IEntityInformationExtractor interface.

    First of all you have to add the following references (I’ve recompiled Rhino Security with NH 3.0) to:

    • Microsoft.Practices.ServiceLocation
    • NHibernate
    • NHibernate.ByteCode.Castle
    • StructureMap
    • Rhino.Security
    • StructureMapAdapter

    Then you define a bootstrapper:

    public static class Bootstrapper
    {
        public static void Initialize()
        {
            ObjectFactory.Initialize(cfg =>
            {
                cfg.UseDefaultStructureMapConfigFile = false;
                cfg.IgnoreStructureMapConfig = true;
                cfg.AddRegistry<StructureMapRegistry>();
            });
            ServiceLocator.SetLocatorProvider(() => new StructureMapServiceLocator(ObjectFactory.Container));
        }
    }
    

    Then you define the StructureMap registry class:

    public class StructureMapRegistry : Registry
    {
        public StructureMapRegistry()
        {
            string ConnDb = "Data Source=(local); Initial Catalog=RhinoSecurity_Test; Trusted_Connection=true;";
    
            For<ISessionFactory>()
                .Singleton()
                .TheDefault.Is.ConstructedBy(() => new NHSessionFactory(ConnDb, false).SessionFactory);
            For<ISession>()
                .Singleton()
                .TheDefault.Is.ConstructedBy(x => x.GetInstance<ISessionFactory>().OpenSession());
            For<IAuthorizationRepository>()
                 .Use<AuthorizationRepository>();
            For<IPermissionsService>()
                .Use<PermissionsService>();
            For<IAuthorizationService>()
                .Use<AuthorizationService>();
            For<IPermissionsBuilderService>()
                .Use<PermissionsBuilderService>();
            For<IEntityInformationExtractor<Model.Task>>()
                .Use(p =>
                    {
                    return (new TaskInfromationExtractor(p.GetInstance<ISession>()));
                    });
        }
    }
    

    NHSessionFactory basically create a a NH session factory.

    I’ve create a class (TaskInfromationExtractor) which implements IEntityInformationExtractor. This will allow you to define permissions for the task entity.
    Now your app is ready. You just have to “bootstrap” structuremap:

    • Bootstrapper.Initialize();

    You would do this when your app starts up.
    Now you can use Rhino security repository and services to create users, groups, relations etc etc. as the links I’ve give you suggest.
    You can find a sample I’ve prepared here

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

Sidebar

Related Questions

I have an ASP.NET MVC project with a form. In the Action method that
I have ASP.Net MVC project. Plus wordpress blog under a subfolder /Blog. Now, when
I have an asp.net MVC project where i need to define some custom routes.
I have an ASP.NET MVC project and I have a single action that accepts
I have a new ASP.NET MVC project (my first), and I had been running
I have nant set up to build my ASP.NET MVC project and it works
I have a Silverlight project (with ASP.net MVC web project) Suddenly, when I press
I have a standard ASP.NET MVC (RC Refresh) web project, with the standard ASP.NET
I'm building an ASP.Net MVC website. Rather than have everything in one project, I've
I am in the start up of a project using ASP.NET MVC and have

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.