Authorization Manager Programming Issue

  • Thread starter Thread starter John Lee
  • Start date Start date
J

John Lee

Hi,

Could someone help me on one issue regarding to Authorization Manager
(AzMan)? Thanks in advance!!!

I first open the AD based azMan store and an application, everything seems
work fine ... but when I tried to programatically to retrieve the tasks
defined for a specific role, instead of getting the tasks list but the role
name itself. (I can get the tasks inside a task correctly :), here is my
code:

_app is defined and opened correctly ...

Microsoft.Interop.Security.AzRoles.IAzRole role = _app.OpenRole(roleName,
null);
System.Array tasks = (System.Array) role.tasks;
for (int i = 0; i < tasks.length; i++)
{
MessageBox.Show(tasks.GetValue(i).ToString());
}

Any help and tips will be greatly appreciated!

Thanks again!
John
 
Hi John,
I tried a similar code in C# and get the same output (the role has 2 tasks
assigned but from my code, array length = 1 and it shows the role name).
Looks like it is a bug in retrieving tasks property. I will write a c++
program for this issue and update you tomorrow.

thanks,
Rhett Gong [MSFT]
Microsoft Online Partner Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks.
 
Hello John,
In my test with C++ and VB, I get the same result as it is in managed env.
I will report it to our product group. And update you here if I get
anything back.


Thanks,
Rhett Gong [MSFT]
Microsoft Online Partner Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks.
 
Hi, Rhett,

I got the answer from PSS group - It looks like that it's by design even
though it's not so intuitive or making sense.

According to Windwos AD group, a role in AzMan actually is implemented as a
task behind the scence with Task.IsRoleDefinition = true so when you
OpenRole, the Tasks collection will only contain the role name - then you
need to use the role name to OpenTask, under task object you can check the
Tasks collection to get all roles under that role and also the tasks under
that role. You can recursively loop all tasks with IsRoleDefinition = True
to get all other tasks.

Thanks!
John
 
Back
Top