Access check with Authorization Manager (Azman)

  • Thread starter Thread starter MS Newsgroups
  • Start date Start date
M

MS Newsgroups

Hi,

Does anyone have a sample on how to perform a access check with Azman in VB
..net ? . I have created a Application Store and defined a application,
tasks, operations and roles. I have managed to instantiate the store with
the code.

Dim mystore As New AzAuthorizationStoreClass
Dim app As IAzApplication
mystore.Initialize(0, "msxml://C:\myStore.xml", Nothing)
app = mystore.OpenApplication("myTestApp", Nothing)

I have created a Context object with the code.

Dim mycontext As
IAzClientContext=app.InitializeClientContextFromName("myUserName",
"myDomain")

Now i want to check if that context has access to Operation1, and this is
where i can't get things working. This is what i have tested
Dim myOperation() As Object = {1} ' 1 is the index number of the operation i
have defined
Dim myScope() As Object = {Nothing}
Dim Result() As Object = {mycontext.AccessCheck("Operation1", myScope,
myOperation).ToString}
msgbox cstr(cint(Result(0))) ' Should return 1 for access and 0 for no
access

The object array i get back seem to be empty.


I have tried to follow the sample in the november issue of MSDN magazine,
but the sample is written in C#

Any idea on where i am going wrong would be appreciated

Many thanks

Niclas
 
Back
Top