मुझे अंततः कल रात "तुलना" लेख मिला।
http://www.c-sharpcorner.com/uploadfile/a.ferendeles/netsqlazman12122006123316pm/netsqlazman.aspx
मैं यहाँ प्रासंगिक हिस्से को चिपकाने के लिए (नीचे) जा रहा हूँ। (बस अगर भविष्य में यह वेबसाइट अस्तित्व में रहती है। मुझे पता है, लेकिन मुझे "जवाब यहां है" लिंक से नफरत है, और जब आप लिंक हिट करते हैं, तो यह एक मृत व्यक्ति है।)
क्या से मैं बता सकता हूँ।
NetSqlAzMan एक (तालिका) उपयोगकर्ता-परिभाषित-फ़ंक्शन प्रदान करता है जिसे आप उपयोगकर्ताओं की सूची (भूमिकाओं/कार्यों को सौंपा जा सकता है) प्रदान करने के लिए अधिभारित कर सकते हैं। NetSqlAzMan न केवल "हाँ आप कर सकते हैं" मैपिंग्स (अनुदान) प्रदान करता है, बल्कि इनकार और अनुदान-साथ-साथ प्रतिनिधि भी प्रदान करता है। NetSqlAzMan और Azman उपयोगकर्ताओं (समूहों) को मैपिंग की अनुमति देता है। केवल NetSqlAzMan उपयोगकर्ताओं को कार्य मैपिंग करने की अनुमति देता है।
कुछ नमूने देखने के बाद ... NetSqlAzMan का ऑब्जेक्ट मॉडल बहुत साफ है।
============================================== =========
सुश्री प्राधिकरण प्रबंधक (Azman) बनाम नेट Sql प्राधिकरण प्रबंधक (NetSqlAzMan)
जैसा कि पहले बताया, एक अनुरूप माइक्रोसॉफ्ट उत्पाद पहले से ही मौजूद है और कहा जाता है प्राधिकरण प्रबंधक (AzMan); AzMan डिफ़ॉल्ट रूप से, Windows Server 2003 में और व्यवस्थापक पैक सेटअप के माध्यम से, Windows XP में मौजूद है। भूमिका अवधारणा और प्रत्येक भूमिका में आपरेशन कंटेनर, जबकि दूसरा है मद आधारित (या -
Azman और NetSqlAzMan के बीच महत्वपूर्ण अंतर यह है कि पहले भूमिका आधारित, है संबंधित के आधार पर है कि, यदि आप ऑपरेशन-आधारित पसंद करते हैं), तो उपयोगकर्ता या उपयोगकर्ता समूह या समूहों के समूह हैं जो भूमिकाओं से संबंधित हो सकते हैं या नहीं कर सकते हैं या ऐसे कार्य और/या संचालन (आइटम) निष्पादित कर सकते हैं।
यहाँ सबसे महत्वपूर्ण सुविधाओं और दो उत्पादों के बीच मतभेद:
सुश्री Azman:
* It's COM.
* It's equipped by a MMC 2.0 (COM) console.
* Its storage can be an XML file or ADAM (Active Directory Application Mode - e un LDAP).
* It's role-based.
* It supports static/dynamic applicative groups, members/not-members.
* Structure based on Roles -> Tasks -> Operations. (Hierarchical Roles and Tasks , none Operations).
* Authorizations can be added only to Roles.
* It doesn't implement the "delegate" concept.
* It doesn't manage authorizations "in the time".
* It doesn't trigger events.
* The only type of authorization is "Allow".
(to "deny" it needs to remove the user/group from his Role).
* It supports Scripting/Biz rules.
* It supports Active Directory users/groups and ADAM users.
NetSqlAzMan:
* It's .NET 2.0.
* It's equipped by a MMC 3.0 (.NET) console.
* Its storage is a Sql Server database(2000/MSDE/2005/Express).
* It's based on Tdo - Typed Data Object technology.
* It's Item-based.
* Structure based on Roles -> Tasks -> Operations. (all hierarchical ones).
* Authorizations can be added to Roles, Task and Operations.
* It supports static/dynamic applicative groups, members/not-members.
* LDAP query testing directly from console.
* It's time-dependant.
* It's delegate-compliant.
* It triggers events (ENS).
* It supports 4 authorization types:
o Allow with delegation (authorized and authorized to delegate).
o Allow (authorized).
o Deny (not authorized).
o Neutral (neutral permission, it depends on higher level Item permission).
* Hierarchical authorizations.
* It supports Scripting/Biz rules (compiled in .NET - C# - VB - and not interpreted)
* It supports Active Directory users/groups and custom users defined in SQL Server Database.
यहाँ एक और पकड़ लिया है।
Azman नमूना कोड: http://channel9.msdn.com/forums/sandbox/252978-AzMan-in-the-Enterprise-Sample-Code http://channel9.msdn.com/forums/sandbox/252973-Programming-AzMan-Sample-Code
using System;
using System.Security.Principal;
using System.Runtime.InteropServices;
using AZROLESLib;
namespace TreyResearch {
public class AzManHelper : IDisposable {
AzAuthorizationStore store;
IAzApplication app;
string appName;
public AzManHelper(string connectionString, string appName) {
this.appName = appName;
try {
// load and initialize the AzMan runtime
store = new AzAuthorizationStore();
store.Initialize(0, connectionString, null);
// drill down to our application
app = store.OpenApplication(appName, null);
}
catch (COMException x) {
throw new AzManException("Failed to initizlize AzManHelper", x);
}
catch (System.IO.FileNotFoundException x) {
throw new AzManException(string.Format("Failed to load AzMan policy from {0} - make sure your connection string is correct.", connectionString), x);
}
}
public void Dispose() {
if (null == app) return;
Marshal.ReleaseComObject(app);
Marshal.ReleaseComObject(store);
app = null;
store = null;
}
public bool AccessCheck(string audit, Operations op,
WindowsIdentity clientIdentity) {
try {
// first step is to create an AzMan context for the client
// this looks at the security identifiers (SIDs) in the user's
// access token and maps them onto AzMan roles, tasks, and operations
IAzClientContext ctx = app.InitializeClientContextFromToken(
(ulong)clientIdentity.Token.ToInt64(), null);
// next step is to see if this user is authorized for
// the requested operation. Note that AccessCheck allows
// you to check multiple operations at once if you desire
object[] scopes = { "" };
object[] operations = { (int)op };
object[] results = (object[])ctx.AccessCheck(audit, scopes, operations,
null, null, null, null, null);
int result = (int)results[0];
return 0 == result;
}
catch (COMException x) {
throw new AzManException("AccessCheck failed", x);
}
}
public bool AccessCheckWithArg(string audit, Operations op,
WindowsIdentity clientIdentity,
string argName, object argValue) {
try {
// first step is to create an AzMan context for the client
// this looks at the security identifiers (SIDs) in the user's
// access token and maps them onto AzMan roles, tasks, and operations
IAzClientContext ctx = app.InitializeClientContextFromToken(
(ulong)clientIdentity.Token.ToInt64(), null);
// next step is to see if this user is authorized for
// the requested operation. Note that AccessCheck allows
// you to check multiple operations at once if you desire
object[] scopes = { "" };
object[] operations = { (int)op };
object[] argNames = { argName };
object[] argValues = { argValue };
object[] results = (object[])ctx.AccessCheck(audit, scopes, operations,
argNames, argValues,
null, null, null);
int result = (int)results[0];
return 0 == result;
}
catch (COMException x) {
throw new AzManException("AccessCheckWithArg failed", x);
}
}
// use this to update a running app
// after you change the AzMan policy
public void UpdateCache() {
try {
store.UpdateCache(null);
Marshal.ReleaseComObject(app);
app = store.OpenApplication(appName, null);
}
catch (COMException x) {
throw new AzManException("UpdateCache failed", x);
}
}
}
public class AzManException : Exception {
public AzManException(string message, Exception innerException)
: base(message, innerException)
{}
}
}
कि Azman सहायक कोड है। वह बदसूरत COM/इंटरऑपिश सामान है।: <
अब जाँच NetSqlAzMan कोड नमूने:
http://netsqlazman.codeplex.com/wikipage?title=Samples
/// <summary>
/// Create a Full Storage through .NET code
/// </summary>
private void CreateFullStorage()
{
// USER MUST BE A MEMBER OF SQL DATABASE ROLE: NetSqlAzMan_Administrators
//Sql Storage connection string
string sqlConnectionString = "data source=(local);initial catalog=NetSqlAzManStorage;user id=netsqlazmanuser;password=password";
//Create an instance of SqlAzManStorage class
IAzManStorage storage = new SqlAzManStorage(sqlConnectionString);
//Open Storage Connection
storage.OpenConnection();
//Begin a new Transaction
storage.BeginTransaction(AzManIsolationLevel.ReadUncommitted);
//Create a new Store
IAzManStore newStore = storage.CreateStore("My Store", "Store description");
//Create a new Basic StoreGroup
IAzManStoreGroup newStoreGroup = newStore.CreateStoreGroup(SqlAzManSID.NewSqlAzManSid(), "My Store Group", "Store Group Description", String.Empty, GroupType.Basic);
//Retrieve current user SID
IAzManSid mySid = new SqlAzManSID(WindowsIdentity.GetCurrent().User);
//Add myself as sid of "My Store Group"
IAzManStoreGroupMember storeGroupMember = newStoreGroup.CreateStoreGroupMember(mySid, WhereDefined.Local, true);
//Create a new Application
IAzManApplication newApp = newStore.CreateApplication("New Application", "Application description");
//Create a new Role
IAzManItem newRole = newApp.CreateItem("New Role", "Role description", ItemType.Role);
//Create a new Task
IAzManItem newTask = newApp.CreateItem("New Task", "Task description", ItemType.Task);
//Create a new Operation
IAzManItem newOp = newApp.CreateItem("New Operation", "Operation description", ItemType.Operation);
//Add "New Operation" as a sid of "New Task"
newTask.AddMember(newOp);
//Add "New Task" as a sid of "New Role"
newRole.AddMember(newTask);
//Create an authorization for myself on "New Role"
IAzManAuthorization auth = newRole.CreateAuthorization(mySid, WhereDefined.Local, mySid, WhereDefined.Local, AuthorizationType.AllowWithDelegation, null, null);
//Create a custom attribute
IAzManAttribute<IAzManAuthorization> attr = auth.CreateAttribute("New Key", "New Value");
//Create an authorization for DB User "Andrea" on "New Role"
IAzManAuthorization auth2 = newRole.CreateAuthorization(mySid, WhereDefined.Local, storage.GetDBUser("Andrea").CustomSid, WhereDefined.Local, AuthorizationType.AllowWithDelegation, null, null);
//Commit transaction
storage.CommitTransaction();
//Close connection
storage.CloseConnection();
}
कि में और स्वयं का एक कहानी कहता है।
मैं सिर्फ इतना है कि लेख और अंक Azman के बारे में किए एक लेख 2006 Azman में तैनात अद्यतन किया गया था से थे और बेहतर (escpecially एपीआई और एसक्यूएल सर्वर स्टोर समर्थन) जब Windows Server 2008 का कहना चाहते थे बाहर आया। लेकिन यह अभी भी प्रतीत होता है कि अज़मान को त्याग दिया गया है। अंतिम Azman टीम ब्लॉग अपडेट 2008 से है। – Haydar
टिप के लिए धन्यवाद। Azman पर लोड नहीं करना है, लेकिन तथ्य यह है कि यह विशिष्ट ओ/एस संस्करणों से जुड़ा हुआ है ...... यह भी मेरे लिए एक परेशानी है। लेकिन यह उन चीजों में से एक हो सकता था जो कुछ बेहतर चीजों के लिए प्रेरणा थी .... – granadaCoder
क्या एनईटीएसक्यूएल अज़मान किसी भी तरह से विंडोज अज़मान पर निर्भर है। चूंकि Azman भविष्य के विंडोज संस्करणों में बहिष्कृत किया जा सकता है, इसका मतलब है कि जब ऐसा होता है तो नेटस्क्लुएल अज़मान काम नहीं करेगा? – Donny