|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UIAuthorization.Providers
{
public abstract class AuthProvider
{
private static AuthProvider _instance;
/// <summary>
/// This method determines whether the user is authorize to perform the requested operation
/// </summary>
public abstract bool CheckAccess(string operation);
/// <summary>
/// This method determines whether the user is authorize to perform the requested operation
/// </summary>
public abstract bool CheckAccess(object commandParameter);
public static void Initialize<TProvider>() where TProvider : AuthProvider, new()
{
_instance = new TProvider();
}
public static void Initialize<TProvider>(object[] parameters)
{
_instance = (AuthProvider)typeof(TProvider).GetConstructor(new Type[] { typeof(object[]) }).Invoke(new object[] { parameters });
}
public static AuthProvider Instance
{
get { return _instance; }
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Elvin Cheng is currently living in Woodlands, Singapore. He has been developing applications with the .NET Framework, using C# and ASP.NET since October 2002. Elvin specializes in building Real-time monitoring and tracking information system for Semi-conductor manufacturing industry. During his spare time, he enjoys reading books, watching movie and gym.