Reflecting your assemblies in an ASP.Net web site
It never fails. You need to reflect through all of the assemblies in you web site and you find that the reflection is missing some of the classes. Asp.net is smart and it does not load a given assembly until it is needed. So how can you reflect through all of the assemblies in your web site? Well first, you don't. Odds are you do not need to reflect through the System and Microsoft assemblies. What you need is a list of the custom assemblies in your web site; Once you hav...
[More]
Extending the ASP.Net Security model to use rights : Part Four - RightPermission
The RightPermission works in the background. Out of sight, out of mind and easily forgotten. But it performs the "hard" work of securing the code. The RightPermission clips in at just over 300 lines of code. If you have not already read Part one - IPrincipal, Part two - IHttpModule and Part three - Attributes go back and take a look; We'll wait for you. First, I am going to give you all the code for the RightPermission and I will cover each method separately. using System;
usi...
[More]
Extending the ASP.Net Security model to use rights : Part Three - Attributes
Part Three- Attributes. Now that we have a Principal object with rights loaded as the current requests user we can begin assigning security to code by the users rights as well as their role membership. The objective here was to be able to tag code to require a right and assign that right to a role. Any user within the role would have the right and be able to execute the code. We have everything in place to do this, except the Attributes. Before e dive into Attributes let me recap wh...
[More]
Extending the ASP.Net Security model to use rights : Part two - the IHttpModule
In part one - IPrincipal, I talked about the right and IPrincipal objects needed to add "right" based security to asp.net applications in addition to role based security. There are a few things we need to do to get ready to build the IHttpModule. First we need something to give us a list of rights for a user. To do this we will create a quick "RightManager" class. We will create a static method "GetRightsByUserName" to return a list of Right objects for a gi...
[More]