September 17, 2009

Using the AzMan Helper Classes V

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 fifth post regarding the usage of these helper classes:
 public void AddMemberToApplicationGroup(string storeUrl, string applicationName, string applicationGroupName, string memberSID)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
IAzApplicationGroup appGroup = ApplicationGroupHelper.GetApplicationGroup(app, applicationGroupName);
appGroup.AddMember(memberSID, null);
appGroup.Submit(0, null);
}

public void RemoveMemberFromApplicationGroup(string storeUrl, string applicationName, string applicationGroupName, string memberSID)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
IAzApplicationGroup appGroup = ApplicationGroupHelper.GetApplicationGroup(app, applicationGroupName);
appGroup.DeleteMember(memberSID, null);
appGroup.Submit(0, null);
}

public void AddMemberNameToApplicationGroup(string storeUrl, string applicationName, string applicationGroupName, string memberName)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
IAzApplicationGroup appGroup = ApplicationGroupHelper.GetApplicationGroup(app, applicationGroupName);
appGroup.AddMemberName(memberName, null);
appGroup.Submit(0, null);
}

public void RemoveMemberNameFromApplicationGroup(string storeUrl, string applicationName, string applicationGroupName, string memberName)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
IAzApplicationGroup appGroup = ApplicationGroupHelper.GetApplicationGroup(app, applicationGroupName);
appGroup.DeleteMemberName(memberName, null);
appGroup.Submit(0, null);
}

//Add Member to denied list
public void AddDeniedMemberToApplicationGroup(string storeUrl, string applicationName, string applicationGroupName, string memberSID)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
IAzApplicationGroup appGroup = ApplicationGroupHelper.GetApplicationGroup(app, applicationGroupName);
appGroup.AddNonMember(memberSID, null);
appGroup.Submit(0, null);
}

public void RemoveDeniedMemberFromApplicationGroup(string storeUrl, string applicationName, string applicationGroupName, string memberSID)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
IAzApplicationGroup appGroup = ApplicationGroupHelper.GetApplicationGroup(app, applicationGroupName);
appGroup.DeleteNonMember(memberSID, null);
appGroup.Submit(0, null);
}

public void AddDeniedMemberNameToApplicationGroup(string storeUrl, string applicationName, string applicationGroupName, string memberName)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
IAzApplicationGroup appGroup = ApplicationGroupHelper.GetApplicationGroup(app, applicationGroupName);
appGroup.AddNonMember(memberName, null);
appGroup.Submit(0, null);
}

public void RemoveDeniedMemberNameFromApplicationGroup(string storeUrl, string applicationName, string applicationGroupName, string memberName)
{
IAzApplication app = ApplicationHelper.GetApplication(storeUrl, applicationName);
IAzApplicationGroup appGroup = ApplicationGroupHelper.GetApplicationGroup(app, applicationGroupName);
appGroup.DeleteNonMemberName(memberName, null);
appGroup.Submit(0, null);
}

No comments:

Post a Comment