September 16, 2009

Using the AzMan Helper Classes IV

To everyone who has sent me "thanks" emails regarding these AzMan tutorials, you are very welcome. It has always been perplexing to me why there are not many examples of AzMan out there. Anyway, back to the next post on this...

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.

Here is the fourth post regarding the usage of these helper classes:
 public string[] GetRoleDefinitions(string storeUrl, string applicationName)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
return RoleDefinitionHelper.GetRoleDefinitionNames(app);
}

public void AddRoleDefinition(string storeUrl, string applicationName, string roleDefinitionName)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
RoleDefinitionHelper.AddRoleDefinition(app, roleDefinitionName);
}

public void RemoveRoleDefinition(string storeUrl, string applicationName, string roleDefinitionName)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
RoleDefinitionHelper.RemoveRoleDefinition(app, roleDefinitionName);
}

public bool IsRoleDefinitionExists(string storeUrl, string applicationName, string roleDefinitionName)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
return RoleDefinitionHelper.IsRoleDefinitionExists(app, roleDefinitionName);
}

public string[] GetApplicationGroups(string storeUrl, string applicationName)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
return ApplicationGroupHelper.GetApplicationGroupNames(app);
}

public void AddApplicationGroup(string storeUrl, string applicationName, string applicationGroupName)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
ApplicationGroupHelper.AddApplicationGroup(app, applicationGroupName);
}

public void RemoveApplicationGroup(string storeUrl, string applicationName, string applicationGroupName)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
ApplicationGroupHelper.RemoveApplicationGroup(app, applicationGroupName);
}

public bool IsApplicationGroupExists(string storeUrl, string applicationName, string applicationGroupName)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
return ApplicationGroupHelper.IsApplicationGroupExists(app, applicationGroupName);
}
I'll have 1-2 more posts on this and then move onto something else.

No comments:

Post a Comment