September 11, 2009

Using the AzMan Helper Classes

We have seen how to add a store,create an application, add an operation, add tasks, create roles, add application groups, and add users via SID or UPN to groups in AzMan using C#. All of these are available here. The question is, how do I use those classes. I will show below some practical uses:
public void AddStore(string storeUrl)
{
StoreHelper.CreateStore(storeUrl);
}

public void RemoveStore(string storeUrl)
{
StoreHelper.RemoveStore(storeUrl);
}

public bool IsStoreExists(string storeUrl)
{
return StoreHelper.IsStoreExists(storeUrl);
}

//Get list of application names
public string[] GetApplications(string storeUrl)
{
IAzAuthorizationStore store = StoreHelper.GetStore(storeUrl);
return ApplicationHelper.GetApplicationNames(store);
}

public void AddApplication(string storeUrl, string applicationName)
{
IAzAuthorizationStore store = StoreHelper.GetStore(storeUrl);
ApplicationHelper.AddApplication(store, applicationName);
}

public void RemoveApplication(string storeUrl, string applicationName)
{
IAzAuthorizationStore store = StoreHelper.GetStore(storeUrl);
ApplicationHelper.RemoveApplication(store, applicationName);
}

public bool IsApplicationExists(string storeUrl, string applicationName)
{
IAzAuthorizationStore store = StoreHelper.GetStore(storeUrl);
return ApplicationHelper.IsApplicationExists(store, applicationName);
}

Here are some very, very, very basic uses of the helper classes. I'll add a few more simple uses over the next day or so.

No comments:

Post a Comment